maven-enforcer-plugin DependencyConvergence rule detecting convergence errors with Titan 1.0.0

1,401 views
Skip to first unread message

Tim Stewart

unread,
Apr 19, 2016, 4:07:59 PM4/19/16
to Aurelius

Hi there!


I'm getting some convergence errors with Titan 1.0.0 and the maven-enforcer plugin.


Here is a bare-bones pom.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.example</groupId>
  <artifactId>convergence</artifactId>
  <version>1.0.0-SNAPSHOT</version>
  <packaging>jar</packaging>
  <name>Convergence</name>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <titan.version>1.0.0</titan.version>
  </properties>
  <dependencies>
     <dependency>
      <groupId>com.thinkaurelius.titan</groupId>
      <artifactId>titan-core</artifactId>
      <version>${titan.version}</version>
      <type>pom</type>
    </dependency>
  </dependencies>
  <build>
    <directory>${basedir}/target</directory>
    <finalName>${project.artifactId}-${project.version}</finalName>
    <resources>
      <resource>
        <directory>${basedir}/src/main/resources
        </directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>${basedir}/src/test/resources
        </directory>
      </testResource>
    </testResources>
    <plugins>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.3.1</version>
        <executions>
          <execution>
            <id>enforce-all</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <DependencyConvergence/>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>


 When I put it in a directory by itself and run "mvn clean compile" I get:


[WARNING] 
Dependency convergence error for org.slf4j:slf4j-api:1.7.12 paths to dependency are:
+-com.example:convergence:1.0.0-SNAPSHOT
  +-com.thinkaurelius.titan:titan-core:1.0.0
    +-org.apache.tinkerpop:gremlin-core:3.0.1-incubating
      +-org.slf4j:slf4j-log4j12:1.7.12
        +-org.slf4j:slf4j-api:1.7.12
and
+-com.example:convergence:1.0.0-SNAPSHOT
  +-com.thinkaurelius.titan:titan-core:1.0.0
    +-org.apache.tinkerpop:gremlin-core:3.0.1-incubating
      +-org.slf4j:jcl-over-slf4j:1.7.12
        +-org.slf4j:slf4j-api:1.7.12
and
+-com.example:convergence:1.0.0-SNAPSHOT
  +-com.thinkaurelius.titan:titan-core:1.0.0
    +-com.codahale.metrics:metrics-core:3.0.1
      +-org.slf4j:slf4j-api:1.7.5
and
+-com.example:convergence:1.0.0-SNAPSHOT
  +-com.thinkaurelius.titan:titan-core:1.0.0
    +-com.codahale.metrics:metrics-ganglia:3.0.1
      +-org.slf4j:slf4j-api:1.7.5
and
+-com.example:convergence:1.0.0-SNAPSHOT
  +-com.thinkaurelius.titan:titan-core:1.0.0
    +-com.codahale.metrics:metrics-graphite:3.0.1
      +-org.slf4j:slf4j-api:1.7.5
and
+-com.example:convergence:1.0.0-SNAPSHOT
  +-com.thinkaurelius.titan:titan-core:1.0.0
    +-org.slf4j:slf4j-api:1.7.5
[WARNING] 
Dependency convergence error for com.google.guava:guava:11.0.2 paths to dependency are:
+-com.example:convergence:1.0.0-SNAPSHOT
  +-com.thinkaurelius.titan:titan-core:1.0.0
    +-org.reflections:reflections:0.9.9-RC1
      +-com.google.guava:guava:11.0.2
and
+-com.example:convergence:1.0.0-SNAPSHOT
  +-com.thinkaurelius.titan:titan-core:1.0.0
    +-com.google.guava:guava:18.0
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.DependencyConvergence failed with message:
Failed while enforcing releasability the error(s) are [
Dependency convergence error for org.slf4j:slf4j-api:1.7.12 paths to dependency are:
+-com.example:convergence:1.0.0-SNAPSHOT
  +-com.thinkaurelius.titan:titan-core:1.0.0
    +-org.apache.tinkerpop:gremlin-core:3.0.1-incubating
      +-org.slf4j:slf4j-log4j12:1.7.12
        +-org.slf4j:slf4j-api:1.7.12
and
+-com.example:convergence:1.0.0-SNAPSHOT
  +-com.thinkaurelius.titan:titan-core:1.0.0
    +-org.apache.tinkerpop:gremlin-core:3.0.1-incubating
      +-org.slf4j:jcl-over-slf4j:1.7.12
        +-org.slf4j:slf4j-api:1.7.12
and
+-com.example:convergence:1.0.0-SNAPSHOT
  +-com.thinkaurelius.titan:titan-core:1.0.0
    +-com.codahale.metrics:metrics-core:3.0.1
      +-org.slf4j:slf4j-api:1.7.5
and
+-com.example:convergence:1.0.0-SNAPSHOT
  +-com.thinkaurelius.titan:titan-core:1.0.0
    +-com.codahale.metrics:metrics-ganglia:3.0.1
      +-org.slf4j:slf4j-api:1.7.5
and
+-com.example:convergence:1.0.0-SNAPSHOT
  +-com.thinkaurelius.titan:titan-core:1.0.0
    +-com.codahale.metrics:metrics-graphite:3.0.1
      +-org.slf4j:slf4j-api:1.7.5
and
+-com.example:convergence:1.0.0-SNAPSHOT
  +-com.thinkaurelius.titan:titan-core:1.0.0
    +-org.slf4j:slf4j-api:1.7.5

Dependency convergence error for com.google.guava:guava:11.0.2 paths to dependency are:
+-com.example:convergence:1.0.0-SNAPSHOT
  +-com.thinkaurelius.titan:titan-core:1.0.0
    +-org.reflections:reflections:0.9.9-RC1
      +-com.google.guava:guava:11.0.2
and
+-com.example:convergence:1.0.0-SNAPSHOT
  +-com.thinkaurelius.titan:titan-core:1.0.0
    +-com.google.guava:guava:18.0
]

I'm under the impression that the maven-enforcer-plugin is a useful tool so I'm hesitant to turn it off.  Please correct me if I'm wrong.

Thanks!

Tim

Marko Rodriguez

unread,
Apr 19, 2016, 4:13:28 PM4/19/16
to aureliu...@googlegroups.com
Hi Tim,

I don't know why Maven just doesn't require the enforcer-plugin on every project! It saves so many headaches when projects have mismatched jar versions.

To solve enforcer-plugin ERRORs, you have to <exclude> intelligently and ensure that only one version of a particular package is actually used and that it works across the projects that leverage those jar classes.

Checkout how I do it in spark-gremlin/ which is <exclude> heavy cause of version conflicts:

HTH,
Marko.
--
You received this message because you are subscribed to the Google Groups "Aurelius" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aureliusgraph...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aureliusgraphs/2df55786-d116-4d14-aaf1-d5cc9fb3db47%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tim Stewart

unread,
Apr 20, 2016, 4:42:29 PM4/20/16
to Aurelius
Great to hear from you Marko!  That cleared up some of the warnings and I'll keep following that example to clear up the rest.  Thanks!
Reply all
Reply to author
Forward
0 new messages