无法执行目标org.codehaus.mojo:exec-maven-plugin。命令执行失败

时间:2013-09-25 13:52:38

标签: maven cucumber

我有一个maven项目。为了运行黄瓜测试我在我的pom文件中有以下配置。

<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 clean install

它给了我以下错误。

    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

请提出任何解决方案并告诉我是否需要分享其他任何内容。

1 个答案:

答案 0 :(得分: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>