I have a war module that is being built and is including a few shrinkwrap jars that it's not supposed to. Namely:
WEB-INF/lib/shrinkwrap-api-1.0.0.jar
WEB-INF/lib/shrinkwrap-descriptors-api-base-2.0.0-alpha-2.jar
WEB-INF/lib/shrinkwrap-descriptors-spi-2.0.0-alpha-2.jar
WEB-INF/lib/shrinkwrap-resolver-api-1.0.0-beta-6.jar
WEB-INF/lib/shrinkwrap-spi-1.0.0.jar
These dependencies are all listed in our poms as test-scoped so they shouldn't be in our packaged war. More info below but my question is: why are these here. There's obviously something I'm missing - what is it/where can I look to find it?
When I show my effective pom, I see the following dependencies (omitting a bunch of stuff here):
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
...
<dependencyManagement>
<dependencies>
...
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-extension-descriptors</artifactId>
<version>1.0.0-beta-6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-api</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-spi</artifactId>
<version>1.0.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-base</artifactId>
<version>1.0.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-api</artifactId>
<version>1.0.0-beta-6</version>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-api-maven</artifactId>
<version>1.0.0-beta-6</version>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
<version>1.0.0-beta-6</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-api-base</artifactId>
<version>2.0.0-alpha-2</version>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-api-javaee</artifactId>
<version>2.0.0-alpha-2</version>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-api-jboss</artifactId>
<version>2.0.0-alpha-2</version>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-gen</artifactId>
<version>2.0.0-alpha-2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-impl-base</artifactId>
<version>2.0.0-alpha-2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-impl-javaee</artifactId>
<version>2.0.0-alpha-2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-impl-jboss</artifactId>
<version>2.0.0-alpha-2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-spi</artifactId>
<version>2.0.0-alpha-2</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
...
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-api-maven</artifactId>
<version>1.0.0-beta-6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
<version>1.0.0-beta-6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-base</artifactId>
<version>1.0.0</version>
<scope>test</scope>
</dependency>
</dependencies>
...
</project>
When I print the dependency tree, I get the output below (only showing nodes that have the jars in question in them. I do see that some of these jars are listed as "runtime" and "runtime (scope managed from test)" but I'm not sure if that is related or how they got switched/included as runtime since in most of the cases, the dependency those belong to are test-scope:
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ name_removed ---
...
[INFO] +- org.jboss.arquillian.extension:arquillian-seam2:jar:1.0.0.Alpha2:test
[INFO] | \- org.jboss.shrinkwrap:shrinkwrap-extension-descriptors:jar:1.0.0-beta-6:test (version managed from 1.0.0-beta-5)
[INFO] +- org.jboss.arquillian.protocol:arquillian-protocol-servlet:jar:1.0.0.Final:test
[INFO] | +- org.jboss.arquillian.container:arquillian-container-spi:jar:1.0.0.Final:test
[INFO] | | +- org.jboss.arquillian.config:arquillian-config-api:jar:1.0.0.Final:test
[INFO] | | \- org.jboss.arquillian.config:arquillian-config-impl-base:jar:1.0.0.Final:test
[INFO] | +- org.jboss.arquillian.container:arquillian-container-test-api:jar:1.0.0.Final:test
[INFO] | \- org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-spi:jar:2.0.0-alpha-2:runtime
[INFO] | \- org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-api-base:jar:2.0.0-alpha-2:runtime (version managed from 1.2.0-alpha-1)
[INFO] +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-api-maven:jar:1.0.0-beta-6:test (scope not updated to runtime)
[INFO] +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-impl-maven:jar:1.0.0-beta-6:test (scope not updated to runtime)
[INFO] | +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-api:jar:1.0.0-beta-6:test
[INFO] | +- org.sonatype.aether:aether-api:jar:1.8:test
[INFO] | +- org.sonatype.aether:aether-util:jar:1.8:test
[INFO] | +- org.sonatype.aether:aether-connector-wagon:jar:1.8:test
[INFO] | | +- org.sonatype.aether:aether-spi:jar:1.8:test
[INFO] | | \- org.codehaus.plexus:plexus-container-default:jar:1.5.5:test
[INFO] | | +- org.codehaus.plexus:plexus-classworlds:jar:2.2.2:test
[INFO] | | +- org.apache.xbean:xbean-reflect:jar:3.4:test
[INFO] | | | \- commons-logging:commons-logging-api:jar:1.1:test
[INFO] | | \- com.google.collections:google-collections:jar:1.0:test
[INFO] | +- org.apache.maven:maven-aether-provider:jar:3.0.1:test
[INFO] | | +- org.apache.maven:maven-model:jar:3.0.1:test
[INFO] | | +- org.apache.maven:maven-model-builder:jar:3.0.1:test
[INFO] | | +- org.apache.maven:maven-repository-metadata:jar:3.0.1:test
[INFO] | | +- org.sonatype.aether:aether-impl:jar:1.8:test
[INFO] | | +- org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:test
[INFO] | | \- org.codehaus.plexus:plexus-utils:jar:2.0.4:test
[INFO] | +- org.apache.maven:maven-settings-builder:jar:3.0.1:test
[INFO] | | +- org.codehaus.plexus:plexus-interpolation:jar:1.14:test
[INFO] | | +- org.apache.maven:maven-settings:jar:3.0.1:test
[INFO] | | \- org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:test
[INFO] | | \- org.sonatype.plexus:plexus-cipher:jar:1.4:test
[INFO] | +- org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-7:test
[INFO] | +- org.apache.maven.wagon:wagon-file:jar:1.0-beta-7:test
[INFO] | \- org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-beta-7:test
[INFO] | \- org.apache.maven.wagon:wagon-http-shared:jar:1.0-beta-7:test
[INFO] \- org.jboss.shrinkwrap:shrinkwrap-impl-base:jar:1.0.0:test (scope not updated to runtime)
[INFO] \- org.jboss.shrinkwrap:shrinkwrap-spi:jar:1.0.0:runtime (scope managed from test)
[INFO] \- org.jboss.shrinkwrap:shrinkwrap-api:jar:1.0.0:runtime
It looks like this was a problem with a BOM used by Arquillian:
https://issues.jboss.org/browse/ARQ-889
We've updated to the fix version and all is well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With