java - Is it possible to have two mainClass in the pom.xml or be able to run two classes in the same pom.xml? -


I am working on a Java project We use continuous integration with Maven 3, SVN and Jenkins. We have a utility Java project in which we have implemented some useful features. We run a Jenkins work to run the main class in this project. The code snippet on the project pom.xml is:

  & lt; Plugin & gt; .. & lt; ArtifactId & gt; Exec-maven-plugin & lt; / ArtifactId> & Lt; Version & gt; 1.2.1 & lt; / Edition & gt; & Lt; Hanging & gt; & Lt; Execution & gt; & Lt; Goals & gt; & Lt; Goal & gt; Java & lt; / Target & gt; & Lt; / Targets & gt; & Lt; / Execution & gt; & Lt; / Hanging & gt; & Lt; Configuration & gt; & Lt; MainClass & gt; Com.ent.uti.Cleaner & lt; / MainClass & gt; & Lt; Logic & gt; & Lt; Logic & gt; Value 1 & lt; / Logic & gt; & Lt; Logic & gt; Value 2 & lt; / Logic & gt; & Lt; / Logic & gt; & Lt; / Configuration & gt; & Lt; / Plugin & gt;  

This class is executed in Jenkins Task Configuration:

  mvn exec: java -o -f cleaner / pom.xml  

I am thinking that is it possible to implement certain features in a single project and add another work to Jenkins? Are there two main classes in the same pom.xml configuration?

I know that I can make another project and configure the main class in Palm. I think that doing this is not a good idea. Both functions are free, so both of these classes are not suitable for running one another after the other.

Thanks for reading.

You can use profiles for that purpose All the details are available here:

Then your command line will appear:

  mvn -P program1 exec: java -o -f cleaner / pom.xml mvn -P Program2 exec: java -o -f cleaner / pom .xml  

Comments