Maven Project Basics
- Lets create the folder structure
- Maven Directories & Their purpose
- src/main/java: This folder will contain the java code. Generally you would see reverse domain named folders and then code
- src/test/java: This folder will consist of unit testing code
- src/main/resources
- src/main/config
- src/test/resources
- src/main/webapp
- src/main/scripts
- src/site
- When maven goals are executed we would see some generated directories target/*
- Clone the code from Here and execute
mvn package - The jar/war form most of the java packaging types and this will have a naming pattern of
<artifactId>-<version>.<packagingtype>
-
Lets assume we are going to use spring boot dependency
-
Now lets execute mvn compile
-
Goals & Lifecycle phases:
- validate
- clean
- compile
- test
- package
- install: will Copy the artifacts and pom file into local repository
- deploy: will copy the artifacts and the pom file into remote repository
-
To Create basic skeletons we have archetypes. To create a sample webapp
mvn archetype:generate -DarchetypeArtifactId=maven-archetype-webapp
Next Steps
- Lets Start using ci/cd engine Jenkins
