Maven
What is Maven?
• Manages Software Projects
- From Compilation to Distribution to
Documentation to Team Building
• Was created to organize Apache Open Source
projects.
Maven’s Principles
• Convention over configuration
– Standard Directory Layout
– One primary output per project
– Standard Naming Convention
• Declarative execution
• Reuse of build logic
• Coherent organization of dependencies
First Maven Project
mvn archetype:create
-DgroupId=com.mycompany.app
-DartifactId=my-app
mvn archetype:create
-DgroupId=com.mycompany.app
-DartifactId=my-webapp
-DarchetypeArtifactId=maven-archetype-
webapp
Common MVN Commands
mvn compile
mvn package
mvn install
mvn clean
mvn site
Eclipse Maven Plugin
• > mvn eclipse:eclipse
• > mvn idea:idea
• > mvn eclipse:clean
Eclipse Maven Plugin
• > mvn eclipse:eclipse
• > mvn idea:idea
• > mvn eclipse:clean

Maven

  • 1.
  • 2.
    What is Maven? •Manages Software Projects - From Compilation to Distribution to Documentation to Team Building • Was created to organize Apache Open Source projects.
  • 3.
    Maven’s Principles • Conventionover configuration – Standard Directory Layout – One primary output per project – Standard Naming Convention • Declarative execution • Reuse of build logic • Coherent organization of dependencies
  • 4.
    First Maven Project mvnarchetype:create -DgroupId=com.mycompany.app -DartifactId=my-app mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-webapp -DarchetypeArtifactId=maven-archetype- webapp
  • 5.
    Common MVN Commands mvncompile mvn package mvn install mvn clean mvn site
  • 6.
    Eclipse Maven Plugin •> mvn eclipse:eclipse • > mvn idea:idea • > mvn eclipse:clean
  • 7.
    Eclipse Maven Plugin •> mvn eclipse:eclipse • > mvn idea:idea • > mvn eclipse:clean