Test.java
is the class that has the main method
I have added Test.java
in pom.xml
. So that after the maven build, the main method will be called.
Below code snippet, denotes the class name in pom.xml
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<configuration>
<mainClass>com.example.Test</mainClass>
</configuration>
</plugin>
I am running the project using mvn clean install exec:java
command.
As expected, Test.java
is called after a successful maven build.
Is there any option to run Test.java
even after maven build failure?