serenity-bdd / serenity-cucumber4

Other
13 stars 10 forks source link

Dependency convergence #3

Closed KLBonn closed 5 years ago

KLBonn commented 5 years ago

Hi John,

I recently tried to include serenity-cucumber4 together with serenity-core and serenity-junit in my Maven project (to enable JIRA integration), and had some weird errors. So I included the maven-enforcer-plugin with dependencyConvergence rule, and received a number of findings.

Some seem to be less important, but serenity-screenplay and serenity-screenplay-webdriver both include cucumber-core v2.4, colliding with cucumber-core v4.2 actually targeted by this project. So maybe you can add an exclusion to these 2 Gradle dependencies?

Here the complete Maven enforcer output for reference:

[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (enforce) @ some-integrationtest-project ---
[WARNING] 
Dependency convergence error for commons-collections:commons-collections:3.2.2 paths to dependency are:
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-net.serenity-bdd:serenity-model:2.0.42
      +-commons-collections:commons-collections:3.2.2
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-io.appium:java-client:6.1.0
      +-commons-validator:commons-validator:1.6
        +-commons-beanutils:commons-beanutils:1.9.2
          +-commons-collections:commons-collections:3.2.1
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-io.appium:java-client:6.1.0
      +-commons-validator:commons-validator:1.6
        +-commons-collections:commons-collections:3.2.2
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-commons-collections:commons-collections:3.2.2

[WARNING] 
Dependency convergence error for org.seleniumhq.selenium:selenium-support:3.141.59 paths to dependency are:
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-org.seleniumhq.selenium:selenium-server:3.141.59
      +-org.seleniumhq.selenium:selenium-support:3.141.59
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-org.seleniumhq.selenium:selenium-java:3.141.59
      +-org.seleniumhq.selenium:selenium-support:3.141.59
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-org.seleniumhq.selenium:selenium-support:3.141.59
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-io.appium:java-client:6.1.0
      +-org.seleniumhq.selenium:selenium-support:3.12.0

[WARNING] 
Dependency convergence error for org.seleniumhq.selenium:selenium-java:3.141.59 paths to dependency are:
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-org.seleniumhq.selenium:selenium-server:3.141.59
      +-org.seleniumhq.selenium:selenium-java:3.141.59
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-org.seleniumhq.selenium:selenium-java:3.141.59
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-com.paulhammant:ngwebdriver:1.1.4
      +-org.seleniumhq.selenium:selenium-java:3.141.59
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-io.appium:java-client:6.1.0
      +-org.seleniumhq.selenium:selenium-java:3.12.0

[WARNING] 
Dependency convergence error for org.eclipse.jetty:jetty-util:9.4.8.v20171121 paths to dependency are:
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-org.eclipse.jetty:jetty-util:9.4.8.v20171121
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-org.eclipse.jetty:jetty-io:9.4.8.v20171121
      +-org.eclipse.jetty:jetty-util:9.4.8.v20171121
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-net.sourceforge.htmlunit:htmlunit:2.33
      +-org.eclipse.jetty.websocket:websocket-client:9.4.12.v20180830
        +-org.eclipse.jetty:jetty-client:9.4.12.v20180830
          +-org.eclipse.jetty:jetty-http:9.4.12.v20180830
            +-org.eclipse.jetty:jetty-util:9.4.12.v20180830
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-net.sourceforge.htmlunit:htmlunit:2.33
      +-org.eclipse.jetty.websocket:websocket-client:9.4.12.v20180830
        +-org.eclipse.jetty:jetty-xml:9.4.12.v20180830
          +-org.eclipse.jetty:jetty-util:9.4.12.v20180830
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-net.sourceforge.htmlunit:htmlunit:2.33
      +-org.eclipse.jetty.websocket:websocket-client:9.4.12.v20180830
        +-org.eclipse.jetty:jetty-util:9.4.12.v20180830
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-net.sourceforge.htmlunit:htmlunit:2.33
      +-org.eclipse.jetty.websocket:websocket-client:9.4.12.v20180830
        +-org.eclipse.jetty.websocket:websocket-common:9.4.12.v20180830
          +-org.eclipse.jetty:jetty-util:9.4.12.v20180830

[WARNING] 
Dependency convergence error for org.apache.commons:commons-text:1.6 paths to dependency are:
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-net.serenity-bdd:serenity-model:2.0.42
      +-org.apache.commons:commons-text:1.6
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-net.sourceforge.htmlunit:htmlunit:2.33
      +-org.apache.commons:commons-text:1.4

[WARNING] 
Dependency convergence error for io.cucumber:cucumber-core:4.2.0 paths to dependency are:
  +-net.serenity-bdd:serenity-cucumber4:1.0.7
    +-net.serenity-bdd:serenity-screenplay:2.0.42
      +-io.cucumber:cucumber-core:2.4.0
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-cucumber4:1.0.7
    +-net.serenity-bdd:serenity-screenplay-webdriver:2.0.42
      +-io.cucumber:cucumber-core:2.4.0
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-cucumber4:1.0.7
    +-io.cucumber:cucumber-java:4.2.0
      +-io.cucumber:cucumber-core:4.2.0
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-io.cucumber:cucumber-core:2.4.0
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-net.serenity-bdd:serenity-report-resources:2.0.42
      +-io.cucumber:cucumber-core:2.4.0
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-net.serenity-bdd:serenity-model:2.0.42
      +-io.cucumber:cucumber-core:2.4.0
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-net.serenity-bdd:serenity-reports:2.0.42
      +-io.cucumber:cucumber-core:2.4.0
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-net.serenity-bdd:serenity-reports:2.0.42
      +-net.serenity-bdd:serenity-stats:2.0.42
        +-io.cucumber:cucumber-core:2.4.0
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-junit:2.0.42
    +-io.cucumber:cucumber-core:2.4.0

[WARNING] 
Dependency convergence error for org.eclipse.jetty:jetty-io:9.4.8.v20171121 paths to dependency are:
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-org.eclipse.jetty:jetty-io:9.4.8.v20171121
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-net.sourceforge.htmlunit:htmlunit:2.33
      +-org.eclipse.jetty.websocket:websocket-client:9.4.12.v20180830
        +-org.eclipse.jetty:jetty-client:9.4.12.v20180830
          +-org.eclipse.jetty:jetty-http:9.4.12.v20180830
            +-org.eclipse.jetty:jetty-io:9.4.12.v20180830
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-net.sourceforge.htmlunit:htmlunit:2.33
      +-org.eclipse.jetty.websocket:websocket-client:9.4.12.v20180830
        +-org.eclipse.jetty:jetty-client:9.4.12.v20180830
          +-org.eclipse.jetty:jetty-io:9.4.12.v20180830
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-net.sourceforge.htmlunit:htmlunit:2.33
      +-org.eclipse.jetty.websocket:websocket-client:9.4.12.v20180830
        +-org.eclipse.jetty:jetty-io:9.4.12.v20180830
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-net.sourceforge.htmlunit:htmlunit:2.33
      +-org.eclipse.jetty.websocket:websocket-client:9.4.12.v20180830
        +-org.eclipse.jetty.websocket:websocket-common:9.4.12.v20180830
          +-org.eclipse.jetty:jetty-io:9.4.12.v20180830

[WARNING] 
Dependency convergence error for org.seleniumhq.selenium:selenium-api:3.141.59 paths to dependency are:
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-org.seleniumhq.selenium:selenium-server:3.141.59
      +-org.seleniumhq.selenium:selenium-api:3.141.59
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-org.seleniumhq.selenium:selenium-java:3.141.59
      +-org.seleniumhq.selenium:selenium-api:3.141.59
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-org.seleniumhq.selenium:selenium-api:3.141.59
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-org.seleniumhq.selenium:selenium-edge-driver:3.141.59
      +-org.seleniumhq.selenium:selenium-api:3.141.59
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-org.seleniumhq.selenium:selenium-safari-driver:3.141.59
      +-org.seleniumhq.selenium:selenium-api:3.141.59
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-org.seleniumhq.selenium:selenium-opera-driver:3.141.59
      +-org.seleniumhq.selenium:selenium-api:3.141.59
and
+-de.acme:some-integrationtest-project:1.0-SNAPSHOT
  +-net.serenity-bdd:serenity-core:2.0.42
    +-io.appium:java-client:6.1.0
      +-org.seleniumhq.selenium:selenium-api:3.12.0
hariharanravichandran commented 5 years ago

I am also facing the same issue. cucumber version mentioned in serenity-cucumber4 is 4.2.0. But, It is picking up the cucumber version mentioned in the serenity-core which is 2.4.0. Please take a look in to it. When I replcaed Serenity-cucumber jar with serenity-cucumber4, I am getting java.lang.NoClassDefFoundError: cucumber/runner/TimeServiceEventBus

wakaleo commented 5 years ago

The required dependency setup is explained in the documentation and on the README page: https://github.com/serenity-bdd/serenity-cucumber4/blob/master/README.md#adding-the-cucumber-4-dependency