how to run maven project code example
Example 1: run java program maven
mvn exec:java -Dexec.mainClass="com.vineetmanohar.module.Main" -Dexec.args="arg0 arg1 arg2"
Example 2: what is pom.xml
- pom.xml file allows us to add, remove, manage dependencies
and versions from one single location.
- POM stands for project object model
- .xml -> stands for: extensible markup language
Example 3: execute maven project in cmd
#execute the project
mvn exec:java -Dexec.mainClass=com.mycompany.App
Example 4: example of simple maven pom java
<properties> <maven.compiler.release>11</maven.compiler.release> </properties> <build> <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> </plugin> </plugins> </pluginManagement> </build>