You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Robby Morgan (JIRA)" <ji...@apache.org> on 2016/07/06 18:24:11 UTC
[jira] [Comment Edited] (MENFORCER-255) dependencyConvergence gets
confused with jaxen pre-1.1.4 due to cyclical optional dependencies
[ https://issues.apache.org/jira/browse/MENFORCER-255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15364808#comment-15364808 ]
Robby Morgan edited comment on MENFORCER-255 at 7/6/16 6:23 PM:
----------------------------------------------------------------
FWIW, the output from {{mvn dependency:tree}} is:
{noformat}
[INFO] ------------------------------------------------------------------------
[INFO] Building dependency-using-jaxen 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ dependency-using-jaxen ---
[INFO] com.bazaarvoice:dependency-using-jaxen:jar:1.0-SNAPSHOT
[INFO] \- jaxen:jaxen:jar:1.1.6:compile
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building importing-dependency 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ importing-dependency ---
[INFO] com.bazaarvoice:importing-dependency:jar:1.0-SNAPSHOT
[INFO] \- com.bazaarvoice:dependency-using-jaxen:jar:1.0-SNAPSHOT:compile
[INFO] \- jaxen:jaxen:jar:1.1.1:compile
[INFO] +- dom4j:dom4j:jar:1.6.1:compile
[INFO] +- jdom:jdom:jar:1.0:compile
[INFO] +- xml-apis:xml-apis:jar:1.3.02:compile
[INFO] +- xerces:xercesImpl:jar:2.6.2:compile
[INFO] \- xom:xom:jar:1.0:compile
[INFO] +- xerces:xmlParserAPIs:jar:2.6.2:compile
[INFO] +- xalan:xalan:jar:2.6.0:compile
[INFO] \- com.ibm.icu:icu4j:jar:2.6.1:compile
[INFO]
{noformat}
Only {{mvn dependency:tree -Dverbose=true}} reveals the cyclical dependencies with the alternate versions:
{noformat}
[INFO] ------------------------------------------------------------------------
[INFO] Building dependency-using-jaxen 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ dependency-using-jaxen ---
[INFO] com.bazaarvoice:dependency-using-jaxen:jar:1.0-SNAPSHOT
[INFO] \- jaxen:jaxen:jar:1.1.6:compile
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building importing-dependency 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ importing-dependency ---
[INFO] com.bazaarvoice:importing-dependency:jar:1.0-SNAPSHOT
[INFO] \- com.bazaarvoice:dependency-using-jaxen:jar:1.0-SNAPSHOT:compile
[INFO] \- jaxen:jaxen:jar:1.1.1:compile (version managed from 1.1.6)
[INFO] +- (jaxen:jaxen:jar:1.1-beta-6:compile - omitted for cycle)
[INFO] +- dom4j:dom4j:jar:1.6.1:compile
[INFO] +- (jaxen:jaxen:jar:1.0-FCS:compile - omitted for cycle)
[INFO] +- jdom:jdom:jar:1.0:compile
[INFO] +- xml-apis:xml-apis:jar:1.3.02:compile
[INFO] +- xerces:xercesImpl:jar:2.6.2:compile
[INFO] \- xom:xom:jar:1.0:compile
[INFO] +- xerces:xmlParserAPIs:jar:2.6.2:compile
[INFO] +- (xerces:xercesImpl:jar:2.6.2:compile - omitted for duplicate)
[INFO] +- xalan:xalan:jar:2.6.0:compile
[INFO] | \- (xml-apis:xml-apis:jar:1.0.b2:compile - omitted for conflict with 1.3.02)
[INFO] \- com.ibm.icu:icu4j:jar:2.6.1:compile
{noformat}
was (Author: bvrobby):
FWIW, the output from {{mvn dependency:tree}} is:
{noformat}
[INFO] ------------------------------------------------------------------------
[INFO] Building dependency-using-jaxen 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ dependency-using-jaxen ---
[INFO] com.bazaarvoice:dependency-using-jaxen:jar:1.0-SNAPSHOT
[INFO] \- jaxen:jaxen:jar:1.1.6:compile
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building importing-dependency 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ importing-dependency ---
[INFO] com.bazaarvoice:importing-dependency:jar:1.0-SNAPSHOT
[INFO] \- com.bazaarvoice:dependency-using-jaxen:jar:1.0-SNAPSHOT:compile
[INFO] \- jaxen:jaxen:jar:1.1.1:compile
[INFO] +- dom4j:dom4j:jar:1.6.1:compile
[INFO] +- jdom:jdom:jar:1.0:compile
[INFO] +- xml-apis:xml-apis:jar:1.3.02:compile
[INFO] +- xerces:xercesImpl:jar:2.6.2:compile
[INFO] \- xom:xom:jar:1.0:compile
[INFO] +- xerces:xmlParserAPIs:jar:2.6.2:compile
[INFO] +- xalan:xalan:jar:2.6.0:compile
[INFO] \- com.ibm.icu:icu4j:jar:2.6.1:compile
[INFO]
{noformat}
Only {{mvn dependency:tree -Dverbose=true}} reveals the cyclical dependencies with the alternate versions (but it comes with a warning that it is incompatible with Maven 3):
{noformat}
[INFO] ------------------------------------------------------------------------
[INFO] Building dependency-using-jaxen 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ dependency-using-jaxen ---
[INFO] com.bazaarvoice:dependency-using-jaxen:jar:1.0-SNAPSHOT
[INFO] \- jaxen:jaxen:jar:1.1.6:compile
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building importing-dependency 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ importing-dependency ---
[INFO] com.bazaarvoice:importing-dependency:jar:1.0-SNAPSHOT
[INFO] \- com.bazaarvoice:dependency-using-jaxen:jar:1.0-SNAPSHOT:compile
[INFO] \- jaxen:jaxen:jar:1.1.1:compile (version managed from 1.1.6)
[INFO] +- (jaxen:jaxen:jar:1.1-beta-6:compile - omitted for cycle)
[INFO] +- dom4j:dom4j:jar:1.6.1:compile
[INFO] +- (jaxen:jaxen:jar:1.0-FCS:compile - omitted for cycle)
[INFO] +- jdom:jdom:jar:1.0:compile
[INFO] +- xml-apis:xml-apis:jar:1.3.02:compile
[INFO] +- xerces:xercesImpl:jar:2.6.2:compile
[INFO] \- xom:xom:jar:1.0:compile
[INFO] +- xerces:xmlParserAPIs:jar:2.6.2:compile
[INFO] +- (xerces:xercesImpl:jar:2.6.2:compile - omitted for duplicate)
[INFO] +- xalan:xalan:jar:2.6.0:compile
[INFO] | \- (xml-apis:xml-apis:jar:1.0.b2:compile - omitted for conflict with 1.3.02)
[INFO] \- com.ibm.icu:icu4j:jar:2.6.1:compile
{noformat}
> dependencyConvergence gets confused with jaxen pre-1.1.4 due to cyclical optional dependencies
> ----------------------------------------------------------------------------------------------
>
> Key: MENFORCER-255
> URL: https://issues.apache.org/jira/browse/MENFORCER-255
> Project: Maven Enforcer Plugin
> Issue Type: Bug
> Reporter: Robby Morgan
>
> Since its inception, jaxen:jaxen has dependencies on jdom:jdom and dom4j:dom4j, which in turn have dependencies on jaxen:1.1-beta-6 and jaxen:1.0-FCS respectively. In jaxen:1.1.4, the dependencies on jdom and dom4j were marked as optional, whereas before they weren't.
> We've run into a situation with the <dependencyConvergence> rule where, if the jaxen dependency is managed to a pre-1.1.4 version, but the project has any dependency compiled against 1.1.4 or greater, then we get output like:
> {noformat}
> [INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-versions) @ importing-dependency ---
> [WARNING]
> Dependency convergence error for jaxen:jaxen:1.1.1 paths to dependency are:
> +-com.bazaarvoice:importing-dependency:1.0-SNAPSHOT
> +-com.bazaarvoice:dependency-using-jaxen:1.0-SNAPSHOT
> +-jaxen:jaxen:1.1.1
> and
> +-com.bazaarvoice:importing-dependency:1.0-SNAPSHOT
> +-com.bazaarvoice:dependency-using-jaxen:1.0-SNAPSHOT
> +-jaxen:jaxen:1.1.1
> +-jaxen:jaxen:1.1-beta-6
> and
> +-com.bazaarvoice:importing-dependency:1.0-SNAPSHOT
> +-com.bazaarvoice:dependency-using-jaxen:1.0-SNAPSHOT
> +-jaxen:jaxen:1.1.1
> +-jaxen:jaxen:1.0-FCS
> {noformat}
> While this particular issue can be resolved by managing jaxen to 1.1.6 (in importing-dependency), the behavior exhibited has several problems that might crop up in other scenarios:
> # It confusingly indicates that jaxen has a direct dependency on *a different version of itself*.
> # The transitive dependencies are not respecting the explicit version chosen for jaxen in the POM.
> # If the problematic dependency is a transitive dependency outside of local control, then resolving this issue is at the mercy of the some version in the dependency chain restructuring in a way that "miraculously" solves the problem.
> This behavior can be reproduced with the following two POM files:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <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">
> <modelVersion>4.0.0</modelVersion>
> <groupId>com.bazaarvoice</groupId>
> <artifactId>dependency-using-jaxen</artifactId>
> <version>1.0-SNAPSHOT</version>
> <dependencies>
> <dependency>
> <groupId>jaxen</groupId>
> <artifactId>jaxen</artifactId>
> <version>1.1.6</version>
> </dependency>
> </dependencies>
> </project>
> {code}
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <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">
> <modelVersion>4.0.0</modelVersion>
> <groupId>com.bazaarvoice</groupId>
> <artifactId>importing-dependency</artifactId>
> <version>1.0-SNAPSHOT</version>
> <dependencies>
> <dependency>
> <groupId>com.bazaarvoice</groupId>
> <artifactId>dependency-using-jaxen</artifactId>
> <version>1.0-SNAPSHOT</version>
> </dependency>
> </dependencies>
> <dependencyManagement>
> <dependencies>
> <dependency>
> <groupId>jaxen</groupId>
> <artifactId>jaxen</artifactId>
> <version>1.1.1</version>
> </dependency>
> </dependencies>
> </dependencyManagement>
> <build>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-enforcer-plugin</artifactId>
> <version>1.4.1</version>
> <executions>
> <execution>
> <id>enforce-versions</id>
> <phase>initialize</phase>
> <goals>
> <goal>enforce</goal>
> </goals>
> <configuration>
> <rules>
> <dependencyConvergence/>
> </rules>
> </configuration>
> </execution>
> </executions>
> </plugin>
> </plugins>
> </build>
> </project>
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)