2

我有一个 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 干净安装

它给了我以下错误。

    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

请提出任何解决方案,并让我知道是否需要分享其他任何内容。

4

1 回答 1

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>
于 2013-09-25T13:58:56.257 回答