Soaring Eagle L.L.C
Maven OverviewPart II
Denver BEA User’s GroupJanuary 2006Scott Ryan
Soaring Eagle L.L.C
Agenda
• Maven Lifecycle• Plugin project layout• Java Plugin Example• Ant Plugin Example• Plugin packaging• Pom configuration
Soaring Eagle L.L.C
Maven 2.0 lifecycle Summary
• 20 total phaseso validate o compile o test o package o integration-test o verify o install o deploy
Soaring Eagle L.L.C
Maven 2.0 lifecycle
• Lifecycle phases are executed in order• Goals are assigned to phases based on
project type (jar)o Compile - compiler:compileo Package - jar:jar
• Phases have dependencies and previous phases are always executed.
• Plugin goals can tie to lifecycle phases
Soaring Eagle L.L.C
Agenda
• Maven Lifecycle• Plugin project layout• Java Plugin Example• Ant Plugin Example• Plugin packaging• Pom configuration
Soaring Eagle L.L.C
Plug-in Packaging
Soaring Eagle L.L.C
Required Resources
• Java Plug-inso Pom.xmlo Java Code
• Ant Plug-inso Pom.xmlo basename.build.xmlo basename.mojos.xml
Soaring Eagle L.L.C
Agenda
• Maven Lifecycle• Plugin project layout• Java Plugin Example• Ant Plugin Example• Plugin packaging• Pom configuration
Soaring Eagle L.L.C
Hello World
Soaring Eagle L.L.C
Hello with Parameters
Soaring Eagle L.L.C
Pom.xml
Soaring Eagle L.L.C
Using the plug-in
Soaring Eagle L.L.C
Configuring Parameters
Soaring Eagle L.L.C
Configuring Complex Parameter types
• Boolean• Dates• URL’s• Lists• Maps • Properties
Soaring Eagle L.L.C
List example
Soaring Eagle L.L.C
Let’s look at the Weblogic Plug-in
Soaring Eagle L.L.C
Agenda
• Maven Lifecycle• Plugin project layout• Java Plugin Example• Ant Plugin Example• Plugin packaging• Pom configuration
Soaring Eagle L.L.C
Build.xml
Soaring Eagle L.L.C
Mojos.xml
Soaring Eagle L.L.C
Using the Ant mojo in a project
Soaring Eagle L.L.C
Adding Parametersbasename.build.xml
Soaring Eagle L.L.C
Adding Parametersbasename.mojos.xml
Soaring Eagle L.L.C
Soaring Eagle L.L.C
Project configuration
Soaring Eagle L.L.C
Soaring Eagle L.L.C
Agenda
• Maven Lifecycle• Plugin project layout• Java Plugin Example• Ant Plugin Example• Plugin packaging• Real Code
Soaring Eagle L.L.C
Packaging
• Handled by plug-in support• mvn plugin:install• Can support multiple versions• settings.xml or pom.xml determine version
strategies• Plug-in registry allows you to control plug-
in versions
Soaring Eagle L.L.C
Soaring Eagle L.L.C
Agenda
• Maven Lifecycle• Plugin project layout• Java Plugin Example• Ant Plugin Example• Plugin packaging• Real Code
Top Related