执行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] - > [帮助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>
Run Code Online (Sandbox Code Playgroud)