我正在尝试运行一个pom.xml,它最终运行我的java主类。在运行pom.xml时,我收到以下错误:-
pom.xml看起来像这样(主类位于ScreenShotUtility包中):-
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>ScreenShotUtility.ScreenShotutility2</mainClass>
<arguments>
<argument>arg0</argument>
<argument>arg1</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>发布于 2019-02-16 00:19:59
添加
<build>
<defaultGoal>exec:java</defaultGoal>
...
</build>到pom并运行
mvn为什么是exec:java?因为它是exec-maven-plugin:java的缩写,所以构建插件的名称是什么。
https://stackoverflow.com/questions/54713175
复制相似问题