Maven
What can Maven do?
- Dependencies Management: Mange different jar package, package index be stetted in pom.xml
- Execute code
- Test code
- One-click build project
Maven Project Content Structure
- src/main/java –> core code
- src/main/resources –> configure files
- src/test/java –> test code
- src/test/resources –> test configure files
- src/main/webapp –> index.html, js, css, images, etc.
Maven Commends
-
mvn clean –> delete target file why? // if we change env to develop project, because the configuration is different
-
mvn compile –> generate a new targert file from main file
-
mvn test –> compile code from main file and test file
-
mvn package –> (also compile, test)generate target file
-
mvn install (also compile, test, and package) –> install package into local repository
-
mvn deploy
β Project Cycle: from 1 to 5.
Maven Model
- Dependences management
- Build project
Create Maven Project in IDE
- With archetype
- Without archetype (recommend)
end.