exec-maven-plugin exec:java failing: 無法將配置值分配給 java.lang.String 類型的鏡
2022-09-04 03:05:10
执行时,它无法正确解析配置参数,从而引发以下错误:mvn exec:java
[错误]未能在项目自动测试程序上执行目标 org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli): 无法解析 mojo org.codehaus.mojo:exec-maven-plugin:1.2.1:java: 无法将配置值分配给 java.lang.String 类型的数组: [-classpath, Classpath {}, --glue, com.company.test.cucumber, --format, pretty, --format, html:C:\workspace\autotest\target] -> [Help 1]
这是使用的插件配置(使用Apache Maven 3.0.3):
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<includeProjectDependencies>false</includeProjectDependencies>
<includePluginDependencies>true</includePluginDependencies>
<executableDependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-core</artifactId>
</executableDependency>
<mainClass>cucumber.cli.Main</mainClass>
<commandlineArgs>-Dfile.encoding=UTF-8</commandlineArgs>
<arguments>
<argument>-classpath</argument>
<classpath/>
<argument>--glue</argument>
<argument>com.company.test.cucumber</argument>
<argument>--format</argument>
<argument>pretty</argument>
<argument>--format</argument>
<argument>html:${project.basedir}\target</argument>
</arguments>
</configuration>
<dependencies>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-core</artifactId>
<version>1.0.2</version>
</dependency>
</dependencies>
</plugin>