2017-04-06 2 views
0

Cucumberを追加するときに私のPomファイルが動作する理由: 'cucumber-spring'と 'cucumber-guice'?Cucumberを追加するときに私のPOMファイルが動作する理由: 'cucumber-spring'と 'cucumber-guice'?

マイキュウリプロジェクトのセットアップは、以下の依存関係で動作します:次の依存関係を追加する

<build> 
    <pluginManagement> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>3.1</version> 
       <configuration> 
        <source>1.8</source> 
        <target>1.8</target> 
        <fork>true</fork> 
        <!--<executable>C:\Program Files\Java\jdk1.8.0_121\bin\javac.exe</executable> --> 
        <executable>${env.JAVA_HOME}\bin\javac.exe</executable> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>exec-maven-plugin</artifactId> 
       <configuration> 
        <mainClass>Framework.utilities.SendEmailFile</mainClass> 
       </configuration> 
      </plugin> 

      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-surefire-plugin</artifactId> 
       <version>2.19.1</version> 
       <!-- <configuration> <suiteXmlFiles> <suiteXmlFile>ncc.xml</suiteXmlFile> 
        </suiteXmlFiles> <testErrorIgnore>false</testErrorIgnore> <testFailureIgnore>false</testFailureIgnore> 
        </configuration> --> 
      </plugin> 
     </plugins> 
    </pluginManagement> 
</build> 

<dependencies> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>4.12</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>info.cukes</groupId> 
     <artifactId>cucumber-java</artifactId> 
     <version>1.2.5</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>info.cukes</groupId> 
     <artifactId>cucumber-jvm</artifactId> 
     <version>1.2.5</version> 
     <type>pom</type> 
    </dependency> 
    <dependency> 
     <groupId>info.cukes</groupId> 
     <artifactId>cucumber-junit</artifactId> 
     <version>1.2.5</version> 
     <scope>test</scope> 
    </dependency> 

    <dependency> 
     <groupId>info.cukes</groupId> 
     <artifactId>cucumber-core</artifactId> 
     <version>1.2.5</version> 
    </dependency> 

    <dependency> 
     <groupId>info.cukes</groupId> 
     <artifactId>cucumber-html</artifactId> 
     <version>0.2.3</version> 
    </dependency> 

    <dependency> 
     <groupId>info.cukes</groupId> 
     <artifactId>cucumber-java</artifactId> 
     <version>1.2.5</version> 
    </dependency> 

    <dependency> 
     <groupId>info.cukes</groupId> 
     <artifactId>cucumber-jvm-deps</artifactId> 
     <version>1.0.5</version> 
    </dependency> 

    <dependency> 
     <groupId>info.cukes</groupId> 
     <artifactId>gherkin</artifactId> 
     <version>2.12.2</version> 
    </dependency> 

    <dependency> 
     <groupId>org.hamcrest</groupId> 
     <artifactId>hamcrest-all</artifactId> 
     <version>1.3</version> 
    </dependency> 

    <dependency> 
     <groupId>info.cukes</groupId> 
     <artifactId>cucumber-picocontainer</artifactId> 
     <version>1.2.5</version> 
    </dependency> 

    <dependency> 
     <groupId>info.cukes</groupId> 
     <artifactId>cucumber-testng</artifactId> 
     <version>1.2.5</version> 
    </dependency> 
</dependencies> 

は、作業から私のプロジェクトを停止します。

<dependency> 
     <groupId>info.cukes</groupId> 
     <artifactId>cucumber-spring</artifactId> 
     <version>1.2.5</version> 
    </dependency> 

    <dependency> 
     <groupId>info.cukes</groupId> 
     <artifactId>cucumber-guice</artifactId> 
     <version>1.2.5</version> 
    </dependency> 

任意のアイデア?

+1

DIジャーの1つだけをクラスパスに追加できます。あなたはそれらの3つを含めるようにしています。ピコ、guiceまたはバネの間で選択する必要があります – Grasshopper

答えて

1

依存バージョンの問題ですが、キュウリスプリングの下バージョンを試してください。 1.2.4バージョン以下のバージョンを使用してください...そして、mavenプロジェクトを更新してください

<dependency> 
    <groupId>info.cukes</groupId> 
    <artifactId>cucumber-spring</artifactId> 
    <version>1.2.4</version> 
</dependency> 

<dependency> 
    <groupId>info.cukes</groupId> 
    <artifactId>cucumber-guice</artifactId> 
    <version>1.2.4</version> 
</dependency> 
+0

コメントのためにありがとう、私はまだバージョン番号を下げるときに仕事をdosnt恐れる: – Gbru

関連する問題