[英]Unable to run pom.xml
I am trying to run a pom.xml that ultimately runs my java main class. 我试图运行一个pom.xml,最终运行我的Java主类。 On running the pom.xml I am getting the error:- 在运行pom.xml时出现错误:-
The pom.xml looks something like this (main class resides within ScreenShotUtility package):- 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>
Add 加
<build>
<defaultGoal>exec:java</defaultGoal>
...
</build>
to the pom and run 到pom奔跑
mvn
Why exec:java
? 为什么要使用exec:java
? Because it is a shorthand for exec-maven-plugin:java
what is the name of the build-plugin. 因为它是exec-maven-plugin:java
的简写,所以构建插件的名称是什么。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.