Maven remove specific artifacts / artifacts group from dependency:dependency-copy result

StackOverflow https://stackoverflow.com/questions/20708271

  •  20-09-2022
  •  | 
  •  

문제

I have to copy dependencies of some project excluding some of them. Exclusion is to be transitive. OK, this is the task maven-dependency handles without any problem. So far so good.

Next step I need to remove (filter out) some artifacts from all of this directory content. Only specific artifacts or better artifacts group. No transition. This is why I cannot join this with previous step.

Is it doable based on some popular maven plugin? Used maven is 3.x if it does matter.

도움이 되었습니까?

해결책

You can define exclusions to maven dependencies. I hope this is what you are looking for.

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>3.3.1.GA</version>
        <exclusions>
        <exclusion>
            <artifactId>xml-apis</artifactId>
            <groupId>xml-apis</groupId>
        </exclusion>
        </exclusions>
    </dependency>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top