Maven执行某一个方法
通过命令
mvn exec:java -Dexec.mainClass="com.example.Main" [-Dexec.args="argument1"] ...
通过插件
<project>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>com.example.Main</mainClass>
<arguments>
<argument>argument1</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
</project>
通过POM指定
配置
<properties>
<exec.mainClass>fully-qualified-class-name</exec.mainClass>
</properties>
命令
mvn clean compile exec:java
Loading...