I have a Maven project and it has 2 networks (MyTestApp_A and MyTestApp_B) inside one of the packages from the src folder.
I can run these “core” classes in Eclipse if I open them and press the start button. However, Eclipse is bugged, and so I really need to run these two classes on the command line using Maven.
I have not used Maven before, but after I asked for help and did some research, I understand that I need to modify the pom.xml file.
Therefore, I successfully modified my pom.xml file to start one of the applications using the command mvn exec:java -Dexec.mainClass="servers.MyTestApp_B":
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>servers.MyTestApp_A</mainClass>
<includePluginDependencies>false</includePluginDependencies>
</configuration>
</plugin>
</plugins>
Happy to be able to run MyTestApp_A, I tried to add another part of the configuration to run MyTestApp_B:
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>servers.MyTestApp_A</mainClass>
<includePluginDependencies>false</includePluginDependencies>
</configuration>
<configuration>
<mainClass>servers.MyTestApp_B</mainClass>
<includePluginDependencies>false</includePluginDependencies>
</configuration>
</plugin>
</plugins>
. -, 2 <configuration> pom.xml.
, MyTestApp_A MyTestApp_B Maven? pom.xml?