[shrinkwrap-issues] [JBoss JIRA] (SHRINKRES-152) Maven dependency resolution ignores transitive exclusions

Matous Jobanek (JIRA) issues at jboss.org
Wed Aug 19 04:01:26 EDT 2015


     [ https://issues.jboss.org/browse/SHRINKRES-152?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matous Jobanek closed SHRINKRES-152.
------------------------------------
    Resolution: Cannot Reproduce Bug


Cannot reproduce bug, feel free to reopen this issue if it is still valid

> Maven dependency resolution ignores transitive exclusions
> ---------------------------------------------------------
>
>                 Key: SHRINKRES-152
>                 URL: https://issues.jboss.org/browse/SHRINKRES-152
>             Project: ShrinkWrap Resolvers
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Ken H
>
> In certain circumstances, it seems that the Maven resolver (in v2.0.0) is ignoring transitive exclusions.
> Relevant pom.xml:
> {code}
> <dependency>
> 			<groupId>org.drools</groupId>
> 			<artifactId>drools-core</artifactId>
> 			<version>${drools.version}</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.drools</groupId>
> 			<artifactId>drools-compiler</artifactId>
> 			<version>${drools.version}</version>
> 			<exclusions>
> 		      <exclusion>
> 		         <groupId>org.antlr</groupId>
> 		         <artifactId>antlr</artifactId>
> 		      </exclusion>
> 		      <exclusion>
> 		         <groupId>org.antlr</groupId>
> 		         <artifactId>antlr-runtime</artifactId>
> 		      </exclusion>
> 		      <exclusion>
> 		         <groupId>antlr</groupId>
> 		         <artifactId>antlr</artifactId>
> 		      </exclusion>
> 		      <exclusion>
> 		         <groupId>antlr</groupId>
> 		         <artifactId>antlr-runtime</artifactId>
> 		      </exclusion>
> 		    </exclusions>
> 		</dependency>
> 				
> 		<dependency>
> 			<groupId>org.hibernate</groupId>
> 			<artifactId>hibernate-core</artifactId>
> 			<version>4.0.1.Final</version>
> 			<scope>provided</scope>
> 			<exclusions>
> 		      <exclusion>
> 		         <groupId>antlr</groupId>
> 		         <artifactId>antlr</artifactId>
> 		      </exclusion>
> 		   </exclusions>
> 		</dependency>
> {code}
> Expected way to build dependency list:
> {code}
> File[] dependencyFiles = Maven.resolver().loadPomFromFile("pom.xml")
> 			.importRuntimeAndTestDependencies()
> 			.resolve().withTransitivity().asFile();
> {code}
> However, this results in antlr still being added to the dependency list and the resulting WebArchive.
> My temporary workaround is to explicitly exclude the G:A:
> {code}
> File[] dependencyFiles = Maven.resolver().loadPomFromFile("pom.xml")
> 			.importRuntimeAndTestDependencies()
> 			.resolve()
> 			.using( new RejectDependenciesStrategy(false, "org.antlr:antlr", "antlr:antlr") )
> 			.withTransitivity().asFile();
> {code}
> Also note that the false is required in the RejectDependenciesStrategy. Without it, all (yes, all) transitive dependencies are ignored. This may be a separate issue but I want to mention it for anyone attempting this workaround.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


More information about the shrinkwrap-issues mailing list