2017-04-06 71 views
0

爲什麼dosnt我的POM文件在添加黃瓜時起作用:'黃瓜春'和'黃瓜吉斯'?爲什麼dosnt我的POM文件在添加黃瓜時工作:'黃瓜春'和'黃瓜吉斯'?

我的黃瓜項目設置適用於以下依存關係:

<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罐。你正試圖包括其中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