Search code examples
javamavendependenciesdropwizardmaven-enforcer-plugin

Maven dependency for io.github.dropwizard-jobs


I am using io.github.dropwizard-jobs (https://github.com/dropwizard-jobs/dropwizard-jobs) for a scheduler in the Dropwizard project.

POM dependency added

<dependency>
    <groupId>io.github.dropwizard-jobs</groupId>
    <artifactId>dropwizard-jobs-guice</artifactId>
    <version>4.0.0-RELEASE</version>
</dependency>

The integration runs fine locally via eclipse, but when trying to create a package by using mvn clean package, it is giving below error.

[WARNING]
Dependency convergence error for com.mchange:c3p0:0.9.5.4 paths to dependency are:
+-project_name:Scheduler:1.0.0.0
  +-io.github.dropwizard-jobs:dropwizard-jobs-guice:4.0.0-RELEASE
    +-io.github.dropwizard-jobs:dropwizard-jobs-core:4.0.0-RELEASE
      +-com.mchange:c3p0:0.9.5.4
and
+-project_name:Scheduler:1.0.0.0
  +-io.github.dropwizard-jobs:dropwizard-jobs-guice:4.0.0-RELEASE
    +-org.quartz-scheduler:quartz:2.3.1
      +-com.mchange:c3p0:0.9.5.3
and
+-project_name:Scheduler:1.0.0.0
  +-io.github.dropwizard-jobs:dropwizard-jobs-guice:4.0.0-RELEASE
    +-com.mchange:c3p0:0.9.5.4

[WARNING] Rule 0: org.apache.maven.plugins.enforcer.DependencyConvergence failed with message:
Failed while enforcing releasability the error(s) are [
Dependency convergence error for com.mchange:c3p0:0.9.5.4 paths to dependency are:
+-project_name:Scheduler:1.0.0.0
  +-io.github.dropwizard-jobs:dropwizard-jobs-guice:4.0.0-RELEASE
    +-io.github.dropwizard-jobs:dropwizard-jobs-core:4.0.0-RELEASE
      +-com.mchange:c3p0:0.9.5.4
and
+-project_name:Scheduler:1.0.0.0
  +-io.github.dropwizard-jobs:dropwizard-jobs-guice:4.0.0-RELEASE
    +-org.quartz-scheduler:quartz:2.3.1
      +-com.mchange:c3p0:0.9.5.3
and
+-project_name:Scheduler:1.0.0.0
  +-io.github.dropwizard-jobs:dropwizard-jobs-guice:4.0.0-RELEASE
    +-com.mchange:c3p0:0.9.5.4

Please let me know what I am missing or what else needs to be added.


Solution

  • In your POM, the dependency convergence rule is active. This means that the build fails if you have different versions of the same dependency in your dependency tree.

    You need to remedy that by adding a <dependencyManagement> entry that fixes a version for com.mchange:c3p0.