문제

I have this dependency tree:

[INFO] +- org.springframework.ws:org.springframework.ws:jar:2.1.0.RELEASE:compile
[INFO] |  +- org.springframework:org.springframework.aop:jar:3.1.1.RELEASE:compile
[INFO] |  |  \- org.aopalliance:com.springsource.org.aopalliance:jar:1.0.0:compile
[INFO] |  +- org.springframework:org.springframework.oxm:jar:3.1.1.RELEASE:compile
[INFO] |  \- org.springframework.ws:org.springframework.xml:jar:2.1.0.RELEASE:compile
[INFO] |     \- org.apache.ws:com.springsource.org.apache.ws.commons.schema:jar:1.3.2:compile

And I want to exclude (last one):

org.apache.ws:com.springsource.org.apache.ws.commons.schema:jar:1.3.2

which is (according to its pom):

<groupId>org.apache.ws.commons.schema</groupId>
<artifactId>XmlSchema</artifactId>

So I define in root artifact (org.springframework.ws):

<dependency>
    <groupId>org.springframework.ws</groupId>
    <artifactId>org.springframework.ws</artifactId>
    <version>2.1.0.RELEASE</version>
    <exclusions>
        <exclusion>
            <groupId>org.apache.ws.commons.schema</groupId>
            <artifactId>XmlSchema</artifactId>
        </exclusion>
    </exclusions>
</dependency>

And nothing really changes. Artifact I wanted to exclude is still present. Anyone can help me how to make it working?

도움이 되었습니까?

해결책

Exclusion does not exclude separate class. It works with artifacts, i.e. jar files. You indeed can exclude the third party dependency using tag like this:

    <exclusion>
        <groupId>org.apache.ws</groupId>
        <artifactId>com.springsource.org.apache.ws.commons.schema</artifactId>
    </exclusion>

Where:

  • org.apache.ws is group ID
  • com.springsource.org.apache.ws.commons.schema is artifact ID

(from your dependency tree example).

I do not thing that there is a built-in ability to exclude specific class.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top