I am new in maven and I would like to execute 2 java file at the same time. I read a few posts in StackOverflow and because I do have limited knowledge with maven, I couldn't understand how to do it. I attached my pom.xml file here and the command line that I am using in mac terminal is:
mvn compile exec:java -Dexec.mainClass="org.parallel.ParseThread1"
I have another file named: ParseThread2 and every time I am running them separately like this:
mvn compile exec:java -Dexec.mainClass="org.parallel.ParseThread1"
mvn compile exec:java -Dexec.mainClass="org.parallel.ParseThread2"
I want to know if maven is capable of executing both at the same time.
Few posts that i read was:
How to execute multiple ant targets in maven
Executing multiple maven profiles
Maven Build multiple profiles in one go
My pom.xml file is:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.parallel</groupId>
<artifactId>parallel</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>parallel</name>
<url>http://maven.apache.org</url>
<properties>
<maven.compiler.source>1.9</maven.compiler.source>
<maven.compiler.target>1.9</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
</dependencies>
</project>