[
https://issues.apache.org/jira/browse/LUCENE-5217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13771062#comment-13771062
]
Steve Rowe edited comment on LUCENE-5217 at 9/18/13 6:33 PM:
-------------------------------------------------------------
I can't get the wildcard-exclusion-disables-transitive-dependencies thing to
work - I tried with Maven 3.0.3, 3.0.5 and 3.1.0 (on OS X 10.8.4), all behave
the same.
I tested a single Solr module and looked at a single dependency's transitive
dependency: solrj module, zookeeper dependency, and zookeeper's transitive
dependency netty.
Here's the zookeeper dependency config from solrj's POM:
{noformat}
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<exclusions>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.netty</groupId>
<artifactId>netty</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>jline</groupId>
<artifactId>jline</artifactId>
</exclusion>
</exclusions>
</dependency>
{noformat}
Without making any changes, here's the output from running {{mvn -X -DskipTests
install}} under {{maven-build/solr/solrj/src/java/}}:
{noformat}
[INFO] --- maven-remote-resources-plugin:1.4:process (default) @ solr-solrj ---
[...]
[DEBUG] org.apache.solr:solr-solrj:jar:5.0-SNAPSHOT (selected for null)
[DEBUG] org.apache.zookeeper:zookeeper:jar:3.4.5:compile (selected for
compile)
[DEBUG] org.slf4j:slf4j-api:jar:1.6.1:compile (applying version: 1.6.6)
[DEBUG] org.slf4j:slf4j-api:jar:1.6.6:compile (selected for compile)
[DEBUG] commons-io:commons-io:jar:2.1:compile (selected for compile)
[DEBUG] org.noggit:noggit:jar:0.5:compile (selected for compile)
[DEBUG] org.apache.httpcomponents:httpclient:jar:4.2.3:compile (selected for
compile)
[DEBUG] org.apache.httpcomponents:httpcore:jar:4.2.2:compile (selected for
compile)
[DEBUG] commons-logging:commons-logging:jar:1.1.1:compile (selected for
compile)
[DEBUG] commons-codec:commons-codec:jar:1.6:compile (applying version: 1.7)
[DEBUG] commons-codec:commons-codec:jar:1.7:compile (selected for compile)
[DEBUG] org.apache.httpcomponents:httpmime:jar:4.2.3:compile (selected for
compile)
[DEBUG] org.codehaus.woodstox:wstx-asl:jar:3.2.7:runtime (selected for
runtime)
[DEBUG] stax:stax-api:jar:1.0.1:runtime (selected for runtime)
[DEBUG] org.slf4j:jcl-over-slf4j:jar:1.6.6:compile (selected for compile)
[DEBUG] org.slf4j:jul-to-slf4j:jar:1.6.6:compile (selected for compile)
[DEBUG] org.slf4j:slf4j-api:jar:1.6.6:compile (selected for compile)
[DEBUG] org.slf4j:slf4j-log4j12:jar:1.6.6:compile (selected for compile)
[DEBUG] log4j:log4j:jar:1.2.17:compile (applying version: 1.2.16)
[DEBUG] log4j:log4j:jar:1.2.16:compile (selected for compile)
[DEBUG] log4j:log4j:jar:1.2.16:compile (selected for compile)
[DEBUG] junit:junit:jar:4.10:test (selected for test)
{noformat}
You can see above that zookeeper's only transitive dependency is slf4j-api.
I get the same output (and behavior) when I remove netty from my local Maven
repository:
{noformat}
rm -rf ~/.m2/repository/org/jboss/netty
{noformat}
Even when netty isn't in my local repository, Maven doesn't try to download it.
However, when I change the solrj POM to use the wildcard exclusions:
{noformat}
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
{noformat}
I get the following output from running {{mvn -X -DskipTests install}} under
{{maven-build/solr/solrj/src/java/}}:
{noformat}
[INFO] --- maven-remote-resources-plugin:1.4:process (default) @ solr-solrj ---
[...]
[DEBUG] org.apache.solr:solr-solrj:jar:5.0-SNAPSHOT (selected for null)
[DEBUG] org.apache.zookeeper:zookeeper:jar:3.4.5:compile (selected for
compile)
[DEBUG] org.slf4j:slf4j-api:jar:1.6.1:compile (applying version: 1.6.6)
[DEBUG] org.slf4j:slf4j-api:jar:1.6.6:compile (selected for compile)
[DEBUG] org.slf4j:slf4j-log4j12:jar:1.6.1:compile (applying version: 1.6.6)
[DEBUG] org.slf4j:slf4j-log4j12:jar:1.6.6:compile (selected for compile)
[DEBUG] log4j:log4j:jar:1.2.17:compile (applying version: 1.2.16)
[DEBUG] log4j:log4j:jar:1.2.16:compile (selected for compile)
[DEBUG] log4j:log4j:jar:1.2.15:compile (applying version: 1.2.16)
[DEBUG] log4j:log4j:jar:1.2.16:compile (selected for compile)
[DEBUG] jline:jline:jar:0.9.94:compile (applying version: 0.9.1)
[DEBUG] jline:jline:jar:0.9.1:compile (selected for compile)
[DEBUG] Using connector WagonRepositoryConnector with priority 0.0 for
http://maven.restlet.org
Downloading:
http://maven.restlet.org/org/jboss/netty/netty/3.2.2.Final/netty-3.2.2.Final.pom
[DEBUG] Writing tracking file
/Users/sarowe/.m2/repository/org/jboss/netty/netty/3.2.2.Final/netty-3.2.2.Final.pom.lastUpdated
[DEBUG] Using connector WagonRepositoryConnector with priority 0.0 for
http://repo.maven.apache.org/maven2
Downloading:
http://repo.maven.apache.org/maven2/org/jboss/netty/netty/3.2.2.Final/netty-3.2.2.Final.pom
Downloaded:
http://repo.maven.apache.org/maven2/org/jboss/netty/netty/3.2.2.Final/netty-3.2.2.Final.pom
(24 KB at 44.4 KB/sec)
[DEBUG] Writing tracking file
/Users/sarowe/.m2/repository/org/jboss/netty/netty/3.2.2.Final/netty-3.2.2.Final.pom.lastUpdated
[DEBUG] Writing tracking file
/Users/sarowe/.m2/repository/org/jboss/netty/netty/3.2.2.Final/_remote.repositories
[DEBUG] org.jboss.netty:netty:jar:3.2.2.Final:compile (selected for compile)
[DEBUG] commons-io:commons-io:jar:2.1:compile (selected for compile)
[DEBUG] org.noggit:noggit:jar:0.5:compile (selected for compile)
[DEBUG] org.apache.httpcomponents:httpclient:jar:4.2.3:compile (selected for
compile)
[DEBUG] org.apache.httpcomponents:httpcore:jar:4.2.2:compile (selected for
compile)
[DEBUG] commons-logging:commons-logging:jar:1.1.1:compile (selected for
compile)
[DEBUG] commons-codec:commons-codec:jar:1.6:compile (applying version: 1.7)
[DEBUG] commons-codec:commons-codec:jar:1.7:compile (selected for compile)
[DEBUG] org.apache.httpcomponents:httpmime:jar:4.2.3:compile (selected for
compile)
[DEBUG] org.codehaus.woodstox:wstx-asl:jar:3.2.7:runtime (selected for
runtime)
[DEBUG] stax:stax-api:jar:1.0.1:runtime (selected for runtime)
[DEBUG] org.slf4j:jcl-over-slf4j:jar:1.6.6:compile (selected for compile)
[DEBUG] org.slf4j:jul-to-slf4j:jar:1.6.6:compile (selected for compile)
[DEBUG] org.slf4j:slf4j-api:jar:1.6.6:compile (selected for compile)
[DEBUG] org.slf4j:slf4j-log4j12:jar:1.6.6:compile (selected for compile)
[DEBUG] log4j:log4j:jar:1.2.17:compile (applying version: 1.2.16)
[DEBUG] log4j:log4j:jar:1.2.16:compile (selected for compile)
[DEBUG] junit:junit:jar:4.10:test (selected for test)
[DEBUG] Using connector WagonRepositoryConnector with priority 0.0 for
http://maven.restlet.org
Downloading:
http://maven.restlet.org/org/jboss/netty/netty/3.2.2.Final/netty-3.2.2.Final.jar
[DEBUG] Writing tracking file
/Users/sarowe/.m2/repository/org/jboss/netty/netty/3.2.2.Final/netty-3.2.2.Final.jar.lastUpdated
[DEBUG] Using connector WagonRepositoryConnector with priority 0.0 for
http://repo.maven.apache.org/maven2
Downloading:
http://repo.maven.apache.org/maven2/org/jboss/netty/netty/3.2.2.Final/netty-3.2.2.Final.jar
Downloaded:
http://repo.maven.apache.org/maven2/org/jboss/netty/netty/3.2.2.Final/netty-3.2.2.Final.jar
(768 KB at 1839.7 KB/sec)
[DEBUG] Writing tracking file
/Users/sarowe/.m2/repository/org/jboss/netty/netty/3.2.2.Final/netty-3.2.2.Final.jar.lastUpdated
[DEBUG] Writing tracking file
/Users/sarowe/.m2/repository/org/jboss/netty/netty/3.2.2.Final/_remote.repositories
{noformat}
You can see above that Maven is effectively ignoring the wildcard exception -
the zookeeper dependency now has lots of transitive dependencies, and netty,
the one I had removed from my local repo, gets downloaded.
So it looks like this supposed workaround doesn't work at all?
Confusingly, {{mvn dependency:tree}} seems to respect the transitive dependency
disabling intent of wildcard exclusions - zookeeper has no transitive deps:
{noformat}
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ solr-solrj ---
[INFO] org.apache.solr:solr-solrj:jar:5.0-SNAPSHOT
[INFO] +- org.apache.zookeeper:zookeeper:jar:3.4.5:compile
[INFO] +- commons-io:commons-io:jar:2.1:compile
[INFO] +- org.noggit:noggit:jar:0.5:compile
[INFO] +- org.apache.httpcomponents:httpclient:jar:4.2.3:compile
[INFO] +- org.apache.httpcomponents:httpmime:jar:4.2.3:compile
[INFO] | \- org.apache.httpcomponents:httpcore:jar:4.2.2:compile
[INFO] +- org.codehaus.woodstox:wstx-asl:jar:3.2.7:runtime
[INFO] | \- stax:stax-api:jar:1.0.1:runtime
[INFO] +- org.slf4j:jcl-over-slf4j:jar:1.6.6:compile
[INFO] +- org.slf4j:jul-to-slf4j:jar:1.6.6:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.6.6:compile
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.6.6:compile
[INFO] +- log4j:log4j:jar:1.2.16:compile
[INFO] \- junit:junit:jar:4.10:test
{noformat}
was (Author: steve_rowe):
I can't get the wildcard-exclusion-disables-transitive-dependendencies
thing to work - I tried with Maven 3.0.3, 3.0.5 and 3.1.0 (on OS X 10.8.4), all
behave the same.
I tested a single Solr module and looked at a single dependency's transitive
dependency: solrj module, zookeeper dependency, and zookeeper's transitive
dependency netty.
Here's the zookeeper dependency config from solrj's POM:
{noformat}
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<exclusions>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.netty</groupId>
<artifactId>netty</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>jline</groupId>
<artifactId>jline</artifactId>
</exclusion>
</exclusions>
</dependency>
{noformat}
Without making any changes, here's the output from running {{mvn -X -DskipTests
install}} under {{maven-build/solr/solrj/src/java/}}:
{noformat}
[INFO] --- maven-remote-resources-plugin:1.4:process (default) @ solr-solrj ---
[...]
[DEBUG] org.apache.solr:solr-solrj:jar:5.0-SNAPSHOT (selected for null)
[DEBUG] org.apache.zookeeper:zookeeper:jar:3.4.5:compile (selected for
compile)
[DEBUG] org.slf4j:slf4j-api:jar:1.6.1:compile (applying version: 1.6.6)
[DEBUG] org.slf4j:slf4j-api:jar:1.6.6:compile (selected for compile)
[DEBUG] commons-io:commons-io:jar:2.1:compile (selected for compile)
[DEBUG] org.noggit:noggit:jar:0.5:compile (selected for compile)
[DEBUG] org.apache.httpcomponents:httpclient:jar:4.2.3:compile (selected for
compile)
[DEBUG] org.apache.httpcomponents:httpcore:jar:4.2.2:compile (selected for
compile)
[DEBUG] commons-logging:commons-logging:jar:1.1.1:compile (selected for
compile)
[DEBUG] commons-codec:commons-codec:jar:1.6:compile (applying version: 1.7)
[DEBUG] commons-codec:commons-codec:jar:1.7:compile (selected for compile)
[DEBUG] org.apache.httpcomponents:httpmime:jar:4.2.3:compile (selected for
compile)
[DEBUG] org.codehaus.woodstox:wstx-asl:jar:3.2.7:runtime (selected for
runtime)
[DEBUG] stax:stax-api:jar:1.0.1:runtime (selected for runtime)
[DEBUG] org.slf4j:jcl-over-slf4j:jar:1.6.6:compile (selected for compile)
[DEBUG] org.slf4j:jul-to-slf4j:jar:1.6.6:compile (selected for compile)
[DEBUG] org.slf4j:slf4j-api:jar:1.6.6:compile (selected for compile)
[DEBUG] org.slf4j:slf4j-log4j12:jar:1.6.6:compile (selected for compile)
[DEBUG] log4j:log4j:jar:1.2.17:compile (applying version: 1.2.16)
[DEBUG] log4j:log4j:jar:1.2.16:compile (selected for compile)
[DEBUG] log4j:log4j:jar:1.2.16:compile (selected for compile)
[DEBUG] junit:junit:jar:4.10:test (selected for test)
{noformat}
You can see above that zookeeper's only transitive dependency is slf4j-api.
I get the same output (and behavior) when I remove netty from my local Maven
repository:
{noformat}
rm -rf ~/.m2/repository/org/jboss/netty
{noformat}
Even when netty isn't in my local repository, Maven doesn't try to download it.
However, when I change the solrj POM to use the wildcard exclusions:
{noformat}
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
{noformat}
I get the following output from running {{mvn -X -DskipTests install}} under
{{maven-build/solr/solrj/src/java/}}:
{noformat}
[INFO] --- maven-remote-resources-plugin:1.4:process (default) @ solr-solrj ---
[...]
[DEBUG] org.apache.solr:solr-solrj:jar:5.0-SNAPSHOT (selected for null)
[DEBUG] org.apache.zookeeper:zookeeper:jar:3.4.5:compile (selected for
compile)
[DEBUG] org.slf4j:slf4j-api:jar:1.6.1:compile (applying version: 1.6.6)
[DEBUG] org.slf4j:slf4j-api:jar:1.6.6:compile (selected for compile)
[DEBUG] org.slf4j:slf4j-log4j12:jar:1.6.1:compile (applying version: 1.6.6)
[DEBUG] org.slf4j:slf4j-log4j12:jar:1.6.6:compile (selected for compile)
[DEBUG] log4j:log4j:jar:1.2.17:compile (applying version: 1.2.16)
[DEBUG] log4j:log4j:jar:1.2.16:compile (selected for compile)
[DEBUG] log4j:log4j:jar:1.2.15:compile (applying version: 1.2.16)
[DEBUG] log4j:log4j:jar:1.2.16:compile (selected for compile)
[DEBUG] jline:jline:jar:0.9.94:compile (applying version: 0.9.1)
[DEBUG] jline:jline:jar:0.9.1:compile (selected for compile)
[DEBUG] Using connector WagonRepositoryConnector with priority 0.0 for
http://maven.restlet.org
Downloading:
http://maven.restlet.org/org/jboss/netty/netty/3.2.2.Final/netty-3.2.2.Final.pom
[DEBUG] Writing tracking file
/Users/sarowe/.m2/repository/org/jboss/netty/netty/3.2.2.Final/netty-3.2.2.Final.pom.lastUpdated
[DEBUG] Using connector WagonRepositoryConnector with priority 0.0 for
http://repo.maven.apache.org/maven2
Downloading:
http://repo.maven.apache.org/maven2/org/jboss/netty/netty/3.2.2.Final/netty-3.2.2.Final.pom
Downloaded:
http://repo.maven.apache.org/maven2/org/jboss/netty/netty/3.2.2.Final/netty-3.2.2.Final.pom
(24 KB at 44.4 KB/sec)
[DEBUG] Writing tracking file
/Users/sarowe/.m2/repository/org/jboss/netty/netty/3.2.2.Final/netty-3.2.2.Final.pom.lastUpdated
[DEBUG] Writing tracking file
/Users/sarowe/.m2/repository/org/jboss/netty/netty/3.2.2.Final/_remote.repositories
[DEBUG] org.jboss.netty:netty:jar:3.2.2.Final:compile (selected for compile)
[DEBUG] commons-io:commons-io:jar:2.1:compile (selected for compile)
[DEBUG] org.noggit:noggit:jar:0.5:compile (selected for compile)
[DEBUG] org.apache.httpcomponents:httpclient:jar:4.2.3:compile (selected for
compile)
[DEBUG] org.apache.httpcomponents:httpcore:jar:4.2.2:compile (selected for
compile)
[DEBUG] commons-logging:commons-logging:jar:1.1.1:compile (selected for
compile)
[DEBUG] commons-codec:commons-codec:jar:1.6:compile (applying version: 1.7)
[DEBUG] commons-codec:commons-codec:jar:1.7:compile (selected for compile)
[DEBUG] org.apache.httpcomponents:httpmime:jar:4.2.3:compile (selected for
compile)
[DEBUG] org.codehaus.woodstox:wstx-asl:jar:3.2.7:runtime (selected for
runtime)
[DEBUG] stax:stax-api:jar:1.0.1:runtime (selected for runtime)
[DEBUG] org.slf4j:jcl-over-slf4j:jar:1.6.6:compile (selected for compile)
[DEBUG] org.slf4j:jul-to-slf4j:jar:1.6.6:compile (selected for compile)
[DEBUG] org.slf4j:slf4j-api:jar:1.6.6:compile (selected for compile)
[DEBUG] org.slf4j:slf4j-log4j12:jar:1.6.6:compile (selected for compile)
[DEBUG] log4j:log4j:jar:1.2.17:compile (applying version: 1.2.16)
[DEBUG] log4j:log4j:jar:1.2.16:compile (selected for compile)
[DEBUG] junit:junit:jar:4.10:test (selected for test)
[DEBUG] Using connector WagonRepositoryConnector with priority 0.0 for
http://maven.restlet.org
Downloading:
http://maven.restlet.org/org/jboss/netty/netty/3.2.2.Final/netty-3.2.2.Final.jar
[DEBUG] Writing tracking file
/Users/sarowe/.m2/repository/org/jboss/netty/netty/3.2.2.Final/netty-3.2.2.Final.jar.lastUpdated
[DEBUG] Using connector WagonRepositoryConnector with priority 0.0 for
http://repo.maven.apache.org/maven2
Downloading:
http://repo.maven.apache.org/maven2/org/jboss/netty/netty/3.2.2.Final/netty-3.2.2.Final.jar
Downloaded:
http://repo.maven.apache.org/maven2/org/jboss/netty/netty/3.2.2.Final/netty-3.2.2.Final.jar
(768 KB at 1839.7 KB/sec)
[DEBUG] Writing tracking file
/Users/sarowe/.m2/repository/org/jboss/netty/netty/3.2.2.Final/netty-3.2.2.Final.jar.lastUpdated
[DEBUG] Writing tracking file
/Users/sarowe/.m2/repository/org/jboss/netty/netty/3.2.2.Final/_remote.repositories
{noformat}
You can see above that Maven is effectively ignoring the wildcard exception -
the zookeeper dependency now has lots of transitive dependencies, and netty,
the one I had removed from my local repo, gets downloaded.
So it looks like this supposed workaround doesn't work at all?
Confusingly, {{mvn dependency:tree}} seems to respect the transitive dependency
disabling intent of wildcard exclusions - zookeeper has no transitive deps:
{noformat}
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ solr-solrj ---
[INFO] org.apache.solr:solr-solrj:jar:5.0-SNAPSHOT
[INFO] +- org.apache.zookeeper:zookeeper:jar:3.4.5:compile
[INFO] +- commons-io:commons-io:jar:2.1:compile
[INFO] +- org.noggit:noggit:jar:0.5:compile
[INFO] +- org.apache.httpcomponents:httpclient:jar:4.2.3:compile
[INFO] +- org.apache.httpcomponents:httpmime:jar:4.2.3:compile
[INFO] | \- org.apache.httpcomponents:httpcore:jar:4.2.2:compile
[INFO] +- org.codehaus.woodstox:wstx-asl:jar:3.2.7:runtime
[INFO] | \- stax:stax-api:jar:1.0.1:runtime
[INFO] +- org.slf4j:jcl-over-slf4j:jar:1.6.6:compile
[INFO] +- org.slf4j:jul-to-slf4j:jar:1.6.6:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.6.6:compile
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.6.6:compile
[INFO] +- log4j:log4j:jar:1.2.16:compile
[INFO] \- junit:junit:jar:4.10:test
{noformat}
> disable transitive dependencies in maven config
> -----------------------------------------------
>
> Key: LUCENE-5217
> URL: https://issues.apache.org/jira/browse/LUCENE-5217
> Project: Lucene - Core
> Issue Type: Bug
> Reporter: Robert Muir
>
> Our ivy configuration does this: each dependency is specified and so we know
> what will happen. Unfortunately the maven setup is not configured the same
> way.
> Instead the maven setup is configured to download the internet: and it
> excludes certain things specifically.
> This is really hard to configure and maintain: we added a
> 'validate-maven-dependencies' that tries to fail on any extra jars, but all
> it really does is run a license check after maven "runs". It wouldnt find
> unnecessary dependencies being dragged in if something else in lucene was
> using them and thus they had a license file.
> Since maven supports wildcard exclusions: MNG-3832, we can disable this
> transitive shit completely.
> We should do this, so its configuration is the exact parallel of ivy.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]