2013-09-25 139 views
2

我有一個maven項目。要運行黃瓜測試,我在我的pom文件中有以下配置。無法執行目標org.codehaus.mojo:exec-maven-plugin。命令執行失敗

<plugin> 
       <groupId>net.mynetwork</groupId> 
       <artifactId>maven-cucumber-reporting</artifactId> 
       <version>0.0.4</version> 
       <executions> 
        <execution> 
         <id>execution</id> 
         <phase>site</phase> 
         <goals> 
          <goal>generate</goal> 
         </goals> 
         <configuration> 
          <projectName>${project.name}</projectName> 
          <outputDirectory>${project.build.directory}/site/cucumber-html-reports</outputDirectory> 
          <cucumberOutput>${project.build.directory}/cucumber.json</cucumberOutput> 
          <enableFlashCharts>false</enableFlashCharts> 
         </configuration> 
        </execution> 
       </executions> 
      </plugin> 


    <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
        <artifactId>exec-maven-plugin</artifactId> 
        <executions> 
         <execution> 
          <id>cucumber</id> 
          <phase>test</phase> 
          <configuration> 
           <executable>src/scripts/cucumber.sh</executable> 
           <arguments> 
            <argument>${host}</argument> 
            <argument>${port}</argument> 
            <argument>${profile}</argument> 
           </arguments> 
          </configuration> 
          <goals> 
           <goal>exec</goal> 
          </goals> 
         </execution> 
        </executions> 
     </plugin> 

當我執行mvn命令。

MVN全新安裝

它給我下面的錯誤。

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (cucumber) Misconfigured argument, value is null. Set the argument to an empty value if this is the required behaviour. 

Failed to execute goal net.mynetwork:maven-cucumber-reporting:0.0.4 

請提出任何解決方案,並讓我知道是否有其他需要共享。

回答

2

看起來像http://jira.codehaus.org/browse/MEXEC-104。 試試這個:

<plugin> 
     <groupId>org.codehaus.mojo</groupId> 
      <artifactId>exec-maven-plugin</artifactId> 
      <executions> 
       <execution> 
        <id>cucumber</id> 
        <phase>test</phase> 
        <configuration> 
         <executable>src/scripts/cucumber.sh</executable> 
         <commandlineArgs>${host} ${port} ${profile}</commandlineArgs> 
        </configuration> 
        <goals> 
         <goal>exec</goal> 
        </goals> 
       </execution> 
      </executions> 
</plugin> 
+0

,感謝您的快速響應。此解決方案正在工作。你有任何解決方案的錯誤「無法執行目標net.mynetwork:maven-cucumber-reporting:0.0.4」 –

+0

@ArunGenius您聲明該解決方案的工作原理。你有不同的錯誤? –

+0

有兩個錯誤從你的解決方案中解決。我得到的第二個錯誤是「無法執行目標net.mynetwork:maven-cucumber-reporting:0.0.4」。你有這個解決方案嗎? thnx提前。 –