maven overview part i denver java user's group and denver bea user's group jan 2006
DESCRIPTION
Part 1 of an overview of the Maven build systemTRANSCRIPT
![Page 1: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/1.jpg)
Soaring Eagle L.L.C
Maven OverviewPart 1
Denver JBOSS User’s GroupJanuary 2006Scott Ryan
![Page 2: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/2.jpg)
Soaring Eagle L.L.C
Agenda
• Why Maven?• Maven 101• Deployments with Maven• Maven integrations• Maven in the enterprise• Maven 1.0 versus 2.0• Demo
![Page 3: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/3.jpg)
Soaring Eagle L.L.C
Agenda
• Why Maven?• Maven 101• Deployments with Maven• Maven integrations• Maven in the enterprise• Maven 1.0 versus 2.0• Demo
![Page 4: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/4.jpg)
Soaring Eagle L.L.C
Analogy: How to develop an application?
My Application
Frameworks
Solution 1
My Application
Solution 2
Container
E.g. Application Server, Eclipse RCP, Net beans, etc
API
Services
![Page 5: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/5.jpg)
Soaring Eagle L.L.C
Maven Objectives
• Make the build process easy • Provide a uniform build system • Provide quality project information • Provide guidelines for best practices
development • Allow transparent migration to new features
![Page 6: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/6.jpg)
Soaring Eagle L.L.C
How to develop a build?
My Build
Ant tasks
Solution 1: Ant
My Build
Solution 2: Maven
Maven (Container)Task calls
Goals/Plug-ins
« Maven is a build container »
![Page 7: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/7.jpg)
Soaring Eagle L.L.C
Advantages of a Container Approach
• Ability to reuse existing serviceso More than 100 existing Maven plug-ins (jar, cactus,
clover, JIRA, site, dashboard, etc)• Easy to get started
o Just need to configure and extend• Ability to benefit from new services simply by
upgrading• Well-defined and shared structure/architecture
![Page 8: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/8.jpg)
Soaring Eagle L.L.C
Advantages (Cont.)
• Easier to maintaino Knowledgeable resources on the marketo Well-defined structure
• It makes sense to use a custom approach when flexibility is a musto This is not usually the case for builds
![Page 9: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/9.jpg)
Soaring Eagle L.L.C
Agenda
• Why Maven?• Maven 101• Deployments with Maven• Maven integrations• Maven in the enterprise• Maven 1.0 versus 2.0• Demo
![Page 10: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/10.jpg)
Soaring Eagle L.L.C
Current Versions
• Maven 1o 1.0.2 and 1.1-beta-2o maven commando Cut your teeth here and don’t worry about the beta label
• Maven 2o 2.0.1o mvn commando Can run side by side
![Page 11: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/11.jpg)
Soaring Eagle L.L.C
Maven 101
• Maven in 3 concepts:o POM (Project Object Model)o Plug-ins
Made of Goals = Actionso Repositories
• Maven files (1.0)o project.xml
POM (Project Object Model)o maven.xml
Custom goals in Jelly Goal, pre-Goal, post-Goal
o project.properties Runtime Configuration
o build.properties Runtime Configuration
![Page 12: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/12.jpg)
Soaring Eagle L.L.C
Maven (2.0) Project Layout
![Page 13: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/13.jpg)
Soaring Eagle L.L.C
POM (1.0) example (1/2)
![Page 14: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/14.jpg)
Soaring Eagle L.L.C
POM (1.0) example (2/2)
![Page 15: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/15.jpg)
Soaring Eagle L.L.C
Project lifecycle with Maven (1.0) plug-ins (1/2)
Prepare Project Compile/ArchiveUnit tests
Quality checks
- Genapp- JBuilder- Idea- JDeveloper- Eclipse- Scm
- Java- Jar- War- Ejb- Ear- Rar- Uberjar- XDoclet- Test- AspectJ
- Checkstyle- PMD- Findbugs- Clover- Emma- JCoverage- JDepend- Ncss- Patterntesting
1 2 3
![Page 16: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/16.jpg)
Soaring Eagle L.L.C
Project lifecycle with Maven(1.0) plug-ins (2/2)
EnvironmentDeployment
Functional tests
Site/ReportGeneration
Deployment
- JBoss- WebSphere- WebLogic- Jetty- Cactus- Latka- HttpUnit- Abbot- (Cargo)
- Site• Changes• Jira• Dashboard• Changelog• File activity
- Developer activity
• StatCvs
- Site- Dist- Artifact- War/Ejb/Ear/Jar...- Scm- Nsis- (Cargo)
4 5 6
![Page 17: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/17.jpg)
Soaring Eagle L.L.C
Maven 2.0 lifecycle (1)
• validate• generate-sources• process-sources • generate-resources • process-resources• compile• process-classes• post-process
![Page 18: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/18.jpg)
Soaring Eagle L.L.C
Maven 2.0 Lifecycle (2)
• generate-test-sources• process-test-sources• generate-test-resources• process-test-resources• test-compile• test• package
![Page 19: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/19.jpg)
Soaring Eagle L.L.C
Maven 2.0 lifecycle (3)
• before-integration-test• integration-test• after-integration-test• verify• install• deploy
![Page 20: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/20.jpg)
Soaring Eagle L.L.C
Value of a repository structure
• Multiple Levels including environment specific (Dev, QA, Stage, Production)
• Contains Versioned resources• Can control external library usage• Logical Organization of artifacts• Speeds builds using build once philosophy• Provides audit trail (record of build components)• Multilevel security
![Page 21: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/21.jpg)
Soaring Eagle L.L.C
Maven Repositories
Maven coreRemote
Repository
Web Server
LocalRepository
project.xml (POM)
1
2
3
4
JVM 1 JVM 2
HTTP
Get dependencies
Checks if artifact exists in local repository.
Download artifact
Save artifact in local repository
![Page 22: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/22.jpg)
Soaring Eagle L.L.C
Maven 1.0 Repository
![Page 23: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/23.jpg)
Soaring Eagle L.L.C
Maven 2.0 Repository
![Page 24: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/24.jpg)
Soaring Eagle L.L.C
Agenda
• Why Maven?• Maven 101• Deployments with Maven• Maven integrations• Maven in the enterprise• Maven 1.0 versus 2.0• Demo
![Page 25: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/25.jpg)
Soaring Eagle L.L.C
Deployments with Maven
• It’s still an unconsolidated area in (1.0)• Several plug-ins can be used
o Artifacto SCMo Releaseo Disto Siteo Artifact generation pluginso Weblogic Plugin
• In the future, to be replaced by Maven-Wagon and Maven-SCM
![Page 26: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/26.jpg)
Soaring Eagle L.L.C
Release Management
• Integrates with multiple Source code control systems.
• Integrates with JIRA for release management• Allows for separation of concerns to support SOX
initiatives.• Provides audit trail• Easy automation for no touch build and deployment
o Reduces possibility of errors
![Page 27: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/27.jpg)
Soaring Eagle L.L.C
Agenda
• Why Maven?• Maven 101• Deployments with Maven• Maven integrations• Maven in the enterprise• Maven 1.0 versus 2.0• Demo
![Page 28: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/28.jpg)
Soaring Eagle L.L.C
Maven integrations• IDE
o Mevenide (Eclipse + Net beans + JBuilder) Goal launcher Search in well known Maven remote repos POM editor POM validation POM/IDE synchronizer Jelly editor Maven builder nature (know which goals should be run when
resources change)• Continuous builds
o Cruise Control, Damage Control, Gump, Continuum• Future (m2): all Java
o Easier integrationo Talks about a Maven IDE
![Page 29: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/29.jpg)
Soaring Eagle L.L.C
Agenda
• Why Maven?• Maven 101• Deployments with Maven• Maven integrations• Maven in the enterprise• Maven 1.0 versus 2.0• Demo
![Page 30: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/30.jpg)
Soaring Eagle L.L.C
Continuous build
RemoteRepository
Maven Continuous
Build
LocalRepository Synchronization
A B
C
Project C Build
get dependent artifacts from A and B
![Page 31: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/31.jpg)
Soaring Eagle L.L.C
Multi-location Set-up
Src Repository(CVS)
Continuous Build
MavenRemote
Repository
MavenRemote
Repository
Internet connection / leased line
commits
commits
Synchronization (rsync)
Country 1Country 2
![Page 32: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/32.jpg)
Soaring Eagle L.L.C
Maven repositories
Project ARemote
Repository
EnterpriseRemote
Repository
Snapshots
Stable versions
Project BRemote
RepositorySnapshots
![Page 33: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/33.jpg)
Soaring Eagle L.L.C
Team organization
• Build Coacho The new type of Quality Manager?o Overall build responsibility
Schedule build improvements in project iterations Defines quality strategies
E.g. Clover: start at 0% and at each iteration increase to level attained. Fail build if below.o Manages build improvementso Improve build-awareness
Every day commit by team Run local build before commits
o Gather build requirements from teams What checkstyle rules do we want to apply? Is the build running fast enough?
o Analyze reasons for build failures• Build leaders in each team
o Analyze build failureso Ensure build failure are given top priority and get fixed ASAPo Coaches team to be build-aware and listen to team
Project Manager
Build Coach Team N
Build Leader
![Page 34: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/34.jpg)
Soaring Eagle L.L.C
Agenda
• Why Maven?• Maven 101• Deployments with Maven• Maven integrations• Maven in the enterprise• Maven 1.0 versus 2.0• Demo
![Page 35: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/35.jpg)
Soaring Eagle L.L.C
Maven 1.0 VS 2.0
• Maven 1.0o project.xml,
maven.xml, project.properties
o build.propertieso Open Lifecycleo Plug-ins in Jelly
Loose project dependencies
![Page 36: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/36.jpg)
Soaring Eagle L.L.C
Maven 1.0 VS 2.0 (Cont)
• Maven 2.0o Defined Inter-Project
Dependencieso Defined project typeso High performanceo Plug-ins in Marmalade,
Ant or Java
• pom.xml• settings.xml• Defined Lifecycle• Lifecycle based plug-in
goals• Finer grained project
configuration
![Page 37: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/37.jpg)
Soaring Eagle L.L.C
Agenda
• Why Maven?• Maven 101• Deployments with Maven• Maven integrations• Maven in the enterprise• Maven 1.0 versus 2.0• Demo
![Page 38: Maven Overview Part I Denver Java User's Group and Denver BEA User's Group Jan 2006](https://reader035.vdocument.in/reader035/viewer/2022081412/5400f2018d7f72c8628b45f0/html5/thumbnails/38.jpg)
Soaring Eagle L.L.C
Demo time
• Create a new project using the archetype plugin• Create a matching Eclipse project using the eclipse
plugin• Create a jar and run the unit tests (jar/test plug-ins)• Create the developer’s website including reports• Prepare a release• Produce a Release• Continuum