Upload
arnaud-heritier
View
1.329
Download
0
Embed Size (px)
DESCRIPTION
Maven 3.x @ Lava Java Users Group - June 14th, 2012 Apache Maven, the project, the community, the product, ...
Citation preview
Apache Maven 3.x W I L L I T L I V E U P TO I T S P R O M I S E S ?
L A V A J U G - J U N E 2 0 1 2
Arnaud Héritier Software Factory Manager
www.exoplatform.com - Copyright 2012 eXo Platform 2
ARNAUD HÉRIT IER
− eXo - Software Factory Manager − In charge of tools and
methods − Apache Maven :
− Committer since 2004 and member of the Project Management Committee
− Coauthor of « Apache Maven» − published by Pearson (in
French) − Contact me :
− http://aheritier.net − Twitter : @aheritier − Skype : aheritier
www.exoplatform.com - Copyright 2012 eXo Platform 3
1
2
3
4 − Questions
− Why Apache Maven?
− Apache Maven 3.x, Where are we, where are we going to … − Community, Resources, − Backward Compatibility, Performances, Extensibility, Robustness, Pom
− Tesla − What is it ?
Why ? A PA C H E M AV E N ( 3 . X )
www.exoplatform.com - Copyright 2012 eXo Platform 5
DEFINIT ION
− Apache Maven is a software project management and comprehension tool.
− Based on the concept of a project object model (POM) − can manage a project's build, binaries, reporting and documentation
from a central piece of information.
− Apache Maven is standards/conventions driven − How many of you are doing JEE and related developments ?
www.exoplatform.com - Copyright 2012 eXo Platform 6
HISTORY
− Initiated in 2001 by Jason Van Zyl in Alexandria, an Apache Jakarta project,
− Moved to Turbine few months after,
− Became a Top Level Project in 2003.
− 2.0 released in September 2005
− 3.0 released in October 2010 − 3.0.4 – January 2012
www.exoplatform.com - Copyright 2012 eXo Platform 7
CHOOSE YOUR WAY OF THINKING
Conventions approach Scripting approach
www.exoplatform.com - Copyright 2012 eXo Platform 8
COMPETITORS ( IN JAVA LAND)
− Ant + Ivy, Easy Ant, Gant, Gradle, Buildr…
− Script oriented − You can do what you want !
− Reuse many of conventions (directories layout, …) and services (repositories) but without enforcing them
− The risk for them : Not being able to evolve due to the too high level of customization proposed to the user. − We tried on 1 and it died because of that. It was impossible to create a
set of tests to cover all usages. − It’s like providing a framework without a well tested set of public API L
www.exoplatform.com - Copyright 2012 eXo Platform 9
WITH SCRIPTS ORIENTED BUILDS
You can have (if you have good skills)
But often you have (moreover after years …)
www.exoplatform.com - Copyright 2012 eXo Platform 10
WITH MAVEN
We dream to deliver (Maven 3.x)
But yesterday we too often had (Maven 2.x)
Where are we ? Where are we going to ? A PA C H E M AV E N 3 . X
www.exoplatform.com - Copyright 2012 eXo Platform 12
COMMUNITY Apache Maven 3.x
www.exoplatform.com - Copyright 2012 eXo Platform 13
USERS MAIL ING L IST
− [email protected] − Traffic statistics cover a total
of 2338 days (>6y). − Current subscribers: 1902 − Total posts: 95442 − Mean posts per day: 40.82
− http://pulse.apache.org/
− Blue : − Number of subscribers
− Red : − Number of messages per day
www.exoplatform.com - Copyright 2012 eXo Platform 14
DEV MAIL ING L IST
− [email protected] − Traffic statistics cover a total
of 2338 days (>6y). − Current subscribers: 676 − Total posts: 63215 − Mean posts per day: 27,04
− http://pulse.apache.org/
− Blue : − Number of subscribers
− Red : − Number of messages per day
www.exoplatform.com - Copyright 2012 eXo Platform 15
APACHE MAVEN WEB SITE
www.exoplatform.com - Copyright 2012 eXo Platform 16
APACHE MAVEN WEB SITE
www.exoplatform.com - Copyright 2012 eXo Platform 17
DOWLOADS
− Per month downloads
− http://people.apache.org/~vgritsenko/stats/projects/maven.html
www.exoplatform.com - Copyright 2012 eXo Platform 18
RELEASES (LAST 2 MONTHS)
− Plugins − Compiler 2.5.1 (2012-06-04) − Changes 2.7.1 (2012-05-10) − Shade 1.7 (2012-06-01) − Compiler 2.5 (2012-05-27) − Clean 2.5 (2012-05-26) − Release 2.3.1 (2012-05-25) − Invoker 1.6 (2012-05-24) − Remote Resources 1.3
(2012-05-11) − Release 2.3 (2012-05-11) − Site 3.1 (2012-04-30) − Changes 2.7 (2012-04-30) − Compiler 2.4 (2012-04-30) − Site 2.4 (2012-04-26)
− Libraries − Tools 3.0 (2012-05-31) − Runtime 1.0-alpha-3
(2012-05-28) − Testing 2.0 (2012-05-27) − Enforcer 1.1 (2012-05-14) − SCM 1.7 (2012-04-29) − Doxia (base) 1.3 (2012-04-13) − Doxia Sitetools 1.3
(2012-04-17)
www.exoplatform.com - Copyright 2012 eXo Platform 19
THE COMMUNITY
− ~20 PMC, ~20 committers, ~20 emeritus − A community less isolated : more interactions with Eclipse,
Jetty, …
− A new French PMC Chair in few days : Olivier Lamy (Cocorico !!!)
www.exoplatform.com - Copyright 2012 eXo Platform 20
RESOURCES Apache Maven 3.x
www.exoplatform.com - Copyright 2012 eXo Platform 21
BOOKS
− Nicolas De loof Arnaud Héritier − Published by Pearson − Collection Référence − Based on our own
experiences with Maven. − From beginners to experts. − In French only
www.exoplatform.com - Copyright 2012 eXo Platform 22
BOOKS
− Sonatype / O’Reilly : − The Definitive Guide − http://www.sonatype.com/
books − Free download − Available in several
languages
www.exoplatform.com - Copyright 2012 eXo Platform 23
BOOKS
− Apache Maven 2 Effective Implementation − Brett Porter, Maria Odea
Ching − https://www.packtpub.com/
apache-maven-2-effective-implementation/book
www.exoplatform.com - Copyright 2012 eXo Platform 24
BOOKS
− Exist Global − Better builds with Maven − http://www.maestrodev.com/
better-build-maven − Free download
www.exoplatform.com - Copyright 2012 eXo Platform 25
MANY OTHERS RESOURCES
− Many companies are providing trainings and expertise
− Many resources on internet (blogs, ….)
− The main web site : − http://maven.apache.org
− Project’s team wiki : − http://docs.codehaus.org/display/MAVEN
− Project’s users wiki : − http://docs.codehaus.org/display/MAVENUSER
− Mailing lists
− http://maven.apache.org/mail-lists.html
− IRC − irc.codehaus.org - #maven
− Forums − developpez.net (In French) − Stackoverflow
www.exoplatform.com - Copyright 2012 eXo Platform 26
BACKWARD COMPATIBILITY Apache Maven 3.x
www.exoplatform.com - Copyright 2012 eXo Platform 27
BACKWARD COMPATIBIL ITY CRIT ICISMS
− Migration from Maven 1 to 2 was impossible. Everything had to be re-done.
− Updates between 2.x versions and also between 2.0.x weren’t too often without side effects.
www.exoplatform.com - Copyright 2012 eXo Platform 28
BACKWARD COMPATIBIL ITY
− Near to 700 integration tests
− Tested for several months on a large set of OSS projects
− 7 alphas + 3 betas versions − It’s a revolution under the hood but an evolution for end users
www.exoplatform.com - Copyright 2012 eXo Platform 29
MAVEN 3 .0 .X ITS
674
www.exoplatform.com - Copyright 2012 eXo Platform 30
PERFORMANCES Apache Maven 3.x
www.exoplatform.com - Copyright 2012 eXo Platform 31
PERFORMANCES - CRIT ICISMS
− Maven is slow
− It spends its time to download the world
− Whereas everybody has multicore CPUs, it doesn’t allow to process tasks in parallel
www.exoplatform.com - Copyright 2012 eXo Platform 32
PERFORMANCES
− A set of benchmark tools was developed to measure performances (IO, CPU, Memory, Network …)
− Startup and execution times are reduced − Java 5 optimizations − Code cleanup and improvements
− Reduced Memory footprint
− Artifacts Resolution Caching − .lastUpdated files in your local repo − Enforce checks with –U option
www.exoplatform.com - Copyright 2012 eXo Platform 33
PERFORMANCES – PARALLEL BUILDS
− Parallel builds − An execution plan is predefined at startup to define which modules
could be built in // − Requires to have up to date plugins to avoid dead locks and some
others issues − Launch a build with 2 threads
− mvn –T 2 install − Launch a build with 2 threads per CPU core
− mvn –T 2C install
www.exoplatform.com - Copyright 2012 eXo Platform 34
PERFORMANCES - PLUGINS
− Many improvements in plugins − In Surefire/Failsafe to propose various strategies to execute tests in //
and to order them − In Compiler to keep loaded the classloader used by Javac − In Packaging plugins (Assembly, Jar, War, …) by improving
performances in low level libraries (plexus …)
www.exoplatform.com - Copyright 2012 eXo Platform 35
EXTENSIBILITY Apache Maven 3.x
www.exoplatform.com - Copyright 2012 eXo Platform 36
EXTENSIBIL ITY - CRIT ICISMS
− It is difficult and time consuming to extend Maven (write plugins) − Many unknown technologies like Plexus for IOC
− It is difficult/impossible to reuse Maven plugins − Its impossible to extend plugins/mojo and lifecycles
www.exoplatform.com - Copyright 2012 eXo Platform 37
EXTENSIBIL ITY
− New APIs to improve abstraction of underneath implementation − Aether : to manage artifacts and repositories
− Classloader partitioning
− Embeddable
− IOC replaced by Guice − For now (Maven 3.0) a wrapper is hiding the change − You don’t yet use Guice directly (from plugins for example)
www.exoplatform.com - Copyright 2012 eXo Platform 38
ROBUSTNESS Apache Maven 3.x
www.exoplatform.com - Copyright 2012 eXo Platform 39
ROBUSTNESS - CRIT ICISMS
− Builds aren’t predictable
− Errors are difficult to diagnose
www.exoplatform.com - Copyright 2012 eXo Platform 40
ROBUSTNESS - VALIDATIONS
− Many more validations in POMs (warnings or errors) − Missing plugins versions − Duplicated dependencies in a POM − Incoherent inheritance (wrong relative path or parent not in the upper
directory)
− Improved error messages with links to wiki pages for more detailed information
www.exoplatform.com - Copyright 2012 eXo Platform 41
ROBUSTNESS ARTIFACTS MANAGEMENT
− Parent POMs prefer to resolve from repositories − Version less parent will be available in a future 3.x release by using the
relativePath element
− Profiles usage consolidation − No more profiles.xml (incompatible with future polyglot feature)
www.exoplatform.com - Copyright 2012 eXo Platform 42
ROBUSTNESS ARTIFACTS MANAGEMENT
− No more support for legacy repository layout for Maven 1.0
− SNAPSHOTs are always deployed with timestamps
www.exoplatform.com - Copyright 2012 eXo Platform 43
ROBUSTNESS PLUGINS MANAGEMENT
− version is by default RELEASE and no more SNAPSHOT − Affects command-line invocation
− Plugins cannot use versions LATEST or RELEASE − Affects command-line invocation and POM
− Plugins are resolved only from <pluginRepository> entries
www.exoplatform.com - Copyright 2012 eXo Platform 44
ROBUSTNESS – S ITE PLUGIN
− Site is now completely extracted from core − It has its own lifecycle − reporting section in POM becomes useless (moved in configuration)
www.exoplatform.com - Copyright 2012 eXo Platform 45
POM Apache Maven 3.x
www.exoplatform.com - Copyright 2012 eXo Platform 46
CRIT ICISMS
− XML, we don’t like it
− POM is too verbose
− POM v4 didn’t evolve last 5 years − When will you add new common attributes to ease plugins
configuration (encoding …) − New feature like global exclusions
www.exoplatform.com - Copyright 2012 eXo Platform 47
POM
− No change in POM syntax for 3.0.x
− Changes will occur in 3.x versions − New model with a new version − Only new things − Generation / deployment of 4.0.0 current POM to keep backward
compatibility with old versions
− Mixins to allow to import POM fragments
Tesla W H AT I S I T ?
www.exoplatform.com - Copyright 2012 eXo Platform 49
WHAT! YOU FORKED APACHE MAVEN?
www.exoplatform.com - Copyright 2012 eXo Platform 50
A FORK OF APACHE MAVEN ?
− “The build portion of Tesla are extensions to Maven. The small differences in the core I currently have will be contributed back.” - Jason van Zyl
− “It’s fork as long as Apache Maven core differences aren’t proposed to be contributed back AND validated by the Apache Maven team” – Arnaud and others Apache Maven members
www.exoplatform.com - Copyright 2012 eXo Platform 51
WHAT IS TESLA ?
− A new project leaded by Jason Van Zyl
− Sources are on Github : https://github.com/etesla
− License : Eclipse Public License v1.0
− “It is not just about builds. Build, IDE, CI, repository management and provisioning.” - Jason Van Zyl
− It is a set of extensions on top of existing tools : Apache Maven, M2E, Nexus, Hudson, …
www.exoplatform.com - Copyright 2012 eXo Platform 52
FEATURES
− Local repository: − Concurrent Local Repository − Automatic Local Snapshot Purging − Split Local Repository
− Polyglot Support
− development: − Java 5 Annotation-based API − JSR-330 (DI) Components in Plugins
− Build Avoidance API
− Several New Extension Points
− TeslaShell
− More to come!
In Apache since few weeks too
www.exoplatform.com - Copyright 2012 eXo Platform 53
AUTOMATIC LOCAL SNAPSHOT PURGING
www.exoplatform.com - Copyright 2012 eXo Platform 54
POLYGLOT SUPPORT
www.exoplatform.com - Copyright 2012 eXo Platform 55
TESLA SHELL
www.exoplatform.com - Copyright 2012 eXo Platform 56
TESLA SHELL
Thank You Q U E S T I O N S ?
www.exoplatform.com - Copyright 2012 eXo Platform 58
LICENCE ET COPYRIGHTS
− Photos and logos belong to their respective authors/owners
− Various ideas are coming from the excellent presentation done by Matthew McCullough : − http://www.slideshare.net/matthewmccullough/maven-30-at-oredev
− Tesla details are coming from Anders Hammar’s presentation for Jfocus 2012 − http://goo.gl/XNPpQ
www.exoplatform.com - Copyright 2012 eXo Platform 59
LICENCE ET COPYRIGHTS
− Content under Creative Commons 3.0 − Attribution — You must attribute the work in the manner specified by
the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
− Noncommercial — You may not use this work for commercial purposes. − Share Alike — If you alter, transform, or build upon this work, you may
distribute the resulting work only under the same or similar license to this one.
− http://creativecommons.org/licenses/by-nc-sa/3.0/us/