MikeFHay
MikeFHay

Reputation: 8983

Maven find path to dependency with invalid pom

When I call mvn dependency:tree on my project I get the following warnings and error:

[WARNING] The POM for com.sun.xml.stream.buffer:streambuffer:jar:0.4 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details

[WARNING] The POM for org.jvnet.staxex:stax-ex:jar:1.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.1:tree (default-cli) on project rdbms-service: Execution default-cli of goal org.apache.maven.plugins:maven-dependency-plugin:2.1:tree failed: For artifact {org.jvnet.staxex:stax-ex:null:jar}: The version cannot be empty. -> [Help 1]

However because the tree build fails, I don't know which dependency is pulling these invalid dependencies in. Is there any way to find out?

I've tried excluding those jars with mvn dependency:tree -Dexcludes=*stream.buffer,*staxex, but that makes no difference.

Upvotes: 7

Views: 6479

Answers (2)

Sergey Ponomarev
Sergey Ponomarev

Reputation: 3181

org.jvnet.staxex:stax-ex:1.0 appears to miss element in the pom in remote repository, contains instead which was never included in the pom.xml schema AFAIK. Apparently some manually created pom (in a wrong way) that ended up in java.net and then central.

Try to exclude the stax-ex dependency and explicitly define a new one. For example:

        <!-- jaxws-rt with replaced broken stax-ex -->
        <dependency>
            <groupId>com.sun.xml.ws</groupId>
            <artifactId>jaxws-rt</artifactId>
            <version>2.1.7</version>
            <exclusions>
                <exclusion>
                    <groupId>org.jvnet.staxex</groupId>
                    <artifactId>stax-ex</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.jvnet.staxex</groupId>
            <artifactId>stax-ex</artifactId>
            <version>1.2</version>
        </dependency>

Upvotes: 0

Robert Scholte
Robert Scholte

Reputation: 12335

Try mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:tree to force Maven to use a more recent version of the maven-dependency-plugin

Upvotes: 7

Related Questions