Skip to content

Maven

Install Maven

1
2
3
4
5
sudo yum -y update

sudo yum install java-1.8.0-openjdk -y

sudo yum install maven -y

test to see if installed correctly:

1
mvn --version

Get maven to generate a test hello world archetype project:

1
mvn archetype:generate -DgroupId=test.hello -DartifactId=hello-maven -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

run a test with maven on the project

1
mvn test

Compile the hello world app into a package after test is successful:

1
mvn package

run the compiled package

1
java -cp target/hello-maven-1.0-SNAPSHOT.jar test.hello.App