2013-09-25 105 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提前。 –