No edit summary |
No edit summary |
||
| Line 8: | Line 8: | ||
</syntaxhighlight>test to see if installed correctly:<syntaxhighlight lang="bash"> | </syntaxhighlight>test to see if installed correctly:<syntaxhighlight lang="bash"> | ||
mvn --version | mvn --version | ||
</syntaxhighlight>Get maven to generate | </syntaxhighlight>Get maven to generate a test hello world archetype project:<syntaxhighlight lang="bash"> | ||
mvn archetype:generate -DgroupId=com.qa -DartifactId=hello-maven -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false | mvn archetype:generate -DgroupId=com.qa -DartifactId=hello-maven -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false | ||
</syntaxhighlight>run a test with maven on the project<syntaxhighlight lang="bash"> | |||
mvn test | |||
</syntaxhighlight>Compile the hello world app into a package after test is successful:<syntaxhighlight lang="bash"> | |||
mvn package | |||
</syntaxhighlight>run the compiled package<syntaxhighlight lang="bash"> | |||
java -cp target/hello-maven-1.0-SNAPSHOT.jar com.qa.App | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 12:13, 10 September 2024
Install Maven
sudo yum -y update
sudo yum install java-1.8.0-openjdk -y
sudo yum install maven -y
test to see if installed correctly:
mvn --version
Get maven to generate a test hello world archetype project:
mvn archetype:generate -DgroupId=com.qa -DartifactId=hello-maven -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
run a test with maven on the project
mvn test
Compile the hello world app into a package after test is successful:
mvn package
run the compiled package
java -cp target/hello-maven-1.0-SNAPSHOT.jar com.qa.App