Maven

From Piszczynski
Revision as of 12:13, 10 September 2024 by Aleks (talk | contribs)

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