SlideShare una empresa de Scribd logo
1 de 46
Descargar para leer sin conexión
Apache Maven @ eXo Platform
    Hanoï – 09 Feb 2010


                                Arnaud Héritier
                                  eXo Platform
                      Software Factory Manager
Apache Maven
OVERVIEW



   Licensed under a Creative Commons license
Apache Maven
BASICS



   Licensed under a Creative Commons license   3
Definition
●    Apache Maven is a software project management
     and comprehension tool.
●    Based on the concept of a project object model
     (POM), Maven can manage a project's build,
     binaries, reporting and documentation from a
     central piece of information.
●    Apache Maven is a command line tool with some
     IDE integrations.




       Licensed under a Creative Commons license
Conventions
●    1 project = 1 artifact (pom, jar, war, ear, …)

●    Standardized
     -  directories layout
     -  project descriptor (POM)
     -  build lifecycle




          Licensed under a Creative Commons license     5
POM
●    An XML file (pom.xml)                             <?xml version="1.0" encoding="UTF-8"?>!
                                                       <project>!
                                                        <modelVersion>4.0.0</modelVersion>!
                                                        <groupId>org.apache.maven</groupId>!

●    Describing                                         <artifactId>webapp-sample</artifactId>!
                                                        <version>1.1-SNAPSHOT</version>!
     -    Project identification                        <packaging>war</packaging>!
                                                        <name>Simple webapp</name>!
     -    Project version                               <inceptionYear>2007</inceptionYear>!
     -    Project description                           <dependencies>!
                                                         <dependency>!
     -    Build settings                                  <groupId>org.springframework</groupId>!

     -    Dependencies                                    <artifactId>spring-struts</artifactId>!
                                                          <version>2.0.2</version>!
     -    …                                              </dependency>!
                                                         ...!
                                                        </dependencies>!
                                                       </project>!



          Licensed under a Creative Commons license
Dependencies
Without Maven                   With Maven




 Licensed under a Creative Commons license
Dependencies
●    Declaratives
     -  groupId + artifactId + version (+ classifier)
     -  Type (packaging) : jar, war, pom, ear, …

●    Transitives
     -  Lib A needs Lib B
     -  Lib B needs Lib C
     -  Thus Lib A needs Lib C




          Licensed under a Creative Commons license
Dependencies
●    Scope
     -  Compile (by default) : Required to build and run the
        application
     -  Runtime : not required to build the application but
        needed at runtime
            ●    Ex : taglibs
     -    Provided : required to build the application but not
          needed at runtime (provided by the container)
            ●    Ex : Servlet API, Driver SGBD, …
     -    Test : required to build and launch tests but not needed
          by the application itself to build and run
            ●    Ex : Junit, TestNG, DbUnit, …
     -    System : local library with absolute path
            ●    Ex : software products
          Licensed under a Creative Commons license
Dependencies
●    Define all dependencies you are using
     -    and no more !
●    Cleanup your dependencies with
     -    mvn dependency:analyze!
●    Study your dependencies with
     -  mvn dependency:tree!
     -  mvn dependency:list!




          Licensed under a Creative Commons license
Artifact Repository
●    By default :
     -    A central repository
            ●    http://repo1.maven.org/
                 maven2
            ●    Several dozen of Gb of OSS
                 libraries
     -    A local repository
            ●    ${user.home}/.m2/repository
            ●    All artifacts
                  -    Used by maven and its
                       plugins
                  -    Used by your projects
                       (dependencies)
                  -    Produced by your projects



          Licensed under a Creative Commons license
Artifact Repository
                                            ●    By default Maven
                                                 downloads artifacts
                                                 required by the project or
                                                 itself from central
                                            ●    Downloaded artifacts are
                                                 stored in the local
                                                 repository




Licensed under a Creative Commons license
Versions
●    Project and dependency versions
●    Two different version variants
          SNAPSHOT version
            ●    The version number ends with –SNAPSHOT
            ●    The project is in development
            ●    Deliveries are changing over the time and are overridden
                 after each build
            ●    Artifacts are deployed with a timestamp on remote
                 repositories
          RELEASE version
            ●    The version number doesn’t end with –SNAPSHOT
            ●    Binaries won’t change
          Licensed under a Creative Commons license
Versions




Licensed under a Creative Commons license
Versions
●    About SNAPSHOT dependencies
     -    Maven allows the configuration of an update policy.
          The update policy defines the recurrence of checks if
          there is a new SNAPSHOT version available on the
          remote repository :
            ●    always
            ●    daily (by default)
            ●    interval:X (a given period in minutes)
            ●    never
     -    Must not be used in a released project
            ●    They can change thus the release also 
            ●    The release plugin will enforce it 

          Licensed under a Creative Commons license
Versions
●    Use the versions plugin to update all versions in all
     POMs
     -    mvn versions:set 

          –DnewVersion=A.B.C-SNAPSHOT!




          Licensed under a Creative Commons license
Profiles
●    Allow to modify the default behavior of Maven by
     overriding/adding some settings
●    Use mvn help:active-profiles to debug
●    Explicit activation or deactivation
mvn <phases or goals> !
     -PprofileId1,-profileId2 !
     -P!profileId3!




       Licensed under a Creative Commons license
Profiles
●    activeByDefault = If no other profile is activated
●    Activation through Maven settings
<settings>!
  ...!
  <activeProfiles>!
    <activeProfile>profile-1</activeProfile>!
  </activeProfiles>!
  ...!
</settings>!




       Licensed under a Creative Commons license
Profiles
●    Activation based on environment variables
<profiles>!                                         <profiles>!

     <profile>!                                       <profile>!

       <activation>!                                    <activation>!

         <property>!                                      <property>!
                                                               <name>!skip-enforce</name>!
              <name>run-its</name>!
                                                          </property>!
              <value>true</value>!
                                                        </activation>!
         </property>!
                                                        ...!
       </activation>!
                                                      </profile>!
       ...!
                                                    </profiles>!
     </profile>!
</profiles>!


        Licensed under a Creative Commons license
Profiles
●    OS / Java settings
<profiles>!                                         <profiles>!
                                                      <profile>!
     <profile>!
                                                        <activation>!
       <activation>!
                                                             <os>!
         <jdk>[1.3,1.6)</jdk>!
                                                             <name>Windows XP</name>!
       </activation>!
                                                             <family>Windows</family>!
       ...!
                                                             <arch>x86</arch>!
     </profile>!
                                                             <version>5.1.2600</version>!
</profiles>!
                                                        </os>!
                                                      </activation>!
                                                      ...!
                                                      </profile>!
                                                    </profiles>!
        Licensed under a Creative Commons license
Profiles
●    Activation on present or missing files
<profiles>!
     <profile>!
       <activation>!
         <file>!
           <missing>${project.build.directory}/generated-sources/
     axistools/wsdl2java/org/apache/maven</missing>!
         </file>!
       </activation>!
       ...!
     </profile>!
</profiles>!


        Licensed under a Creative Commons license
Reactor
●    Ability of Maven to build                        pom.xml :
     several sub-modules                              <modules>
     resolving the order of their                      <module>moduleA</module>
     dependencies                                      <module>moduleC</module>

●    Modules have to be                                <module>moduleB</module>
     defined in the POM                               </modules>

     -    For a performance reasons




          Licensed under a Creative Commons license
Inheritence
●    Share settings between
     projects/modules
●    Project
     -    Business1
             ●    Jar
             ●    War
     -    Business2
             ●    Jar                                 pom.xml for module Jar1
             ●    War                                 <parent>

●    By default the parent                              <groupId>X.Y.Z</groupId>
     project is supposed to be                          <artifactId>jars</artifactId>
     in the parent directory                            <version>1.0-SNAPSHOT<version>
     (../)                                            </parent>

          Licensed under a Creative Commons license
Build Lifecycle And Plugins
                                            ●    Plugin based architecture
                                                 for a great extensibility
                                            ●    Standardized lifecycle to
                                                 build all types of
                                                 archetypes




Licensed under a Creative Commons license
Apache Maven
GOOD & BAD PRACTICES



   Licensed under a Creative Commons license
Apache Maven
KISS



   Licensed under a Creative Commons license
K.I.S.S.
●    Keep It Simple, Stupid
●    Start from scratch
     -    Do not copy/paste what you find without understanding
●    Use only what you need
     -    It’s not because maven offers many features that you
          need to use them
            ●    Filtering
            ●    Modules
            ●    Profiles
            ●    …


          Licensed under a Creative Commons license
Apache Maven
PROJECT ORGANIZATION
GOOD & BAD PRACTICES


   Licensed under a Creative Commons license
Project bad practices
●    Ignore Maven conventions
     -  Except if your are migrating from something else and
        the target has to be to follow them.
     -  Except if they are not compatible with your IDE
●    Different versions in sub-modules
     -    In that case they are standalone projects.
●    Too many inheritance levels
     -    It makes the POMs maintenance more complex
                  -    Where should I set this plugin parameter ? In which parent ?




          Licensed under a Creative Commons license
Project bad practices
●    Have too many modules
     -    Is there a good reason ?
            ●    Technical constraint ?
            ●    Team organization ?
     -    It increases the build time
            ●    Many more artifacts to generate
            ●    Dependencies resolution more complex
     -    It involves more complex developments
            ●    More modules to import in your IDE
            ●    More modules to update …



          Licensed under a Creative Commons license
Project good practices
●    Use the default
     inheritance :
     -    The reactor project is also
          the parent of its modules.
     -    Configuration is easier :
             ●    No need to redefine SCM
                  settings, site distribution
                  settings …




          Licensed under a Creative Commons license
Apache Maven
POM GOOD & BAD PRACTICES



   Licensed under a Creative Commons license
POM bad practices
●    Dependencies :
     -    DON’T confuse dependencies and
          dependencyManagement
●    Plugins :
     -  DON’T confuse plugins and pluginManagement
     -  DON’T use AntRun plugin everywhere
     -  DON’T let Maven choose plugins versions for you




          Licensed under a Creative Commons license
POM bad practices
●    Profiles :
     -  DON’T create environment dependant builds
     -  DON’T rely on dependencies coming from profiles
        (there is no transitive activation of profiles)
●    Reporting and quality
     -  DON’T activate on an existing project all reports with
        default configuration
     -  DON’T control formatting rules without giving settings
        for IDEs.
●    DON’T put everything you find in your POM.


          Licensed under a Creative Commons license
POM good practices
●    Set versions of dependencies in project parent’s
     dependencyManagement
●    Set dependencies (groupId, artifactId, scope) in
     each module they are used
●    Use the dependency plugin (from apache) and
     versions plugin (from mojo) to analyze, cleanup
     and update your dependencies.




       Licensed under a Creative Commons license
Apache Maven
DEVELOPMENT
GOOD & BAD PRACTICES


   Licensed under a Creative Commons license
Development bad practices
●    DON’T spend your time in the terminal,
●    DON’T exchange libraries through emails,
●    DON’T always use "-Dmaven.test.skip=true”
●    DON’T manually do releases




       Licensed under a Creative Commons license
Development good practices
●    Keep up-to-date your version of Maven
     -    For example in 2.1 the time of dependencies/modules
          resolution decreased a lot (Initialization of a project of
          150 modules passed from 8 minutes to less than 1)
●    Use the reactor plugin (Maven < 2.1) or native
     reactor command line options (Maven >= 2.1) to
     rebuild only a subpart of your project :
     -  All modules depending on module XXX
     -  All modules used to build XXX
●    Try to not use Maven features not supported by
     your IDE (resources filtering with the plugin
     eclipse:eclipse)
          Licensed under a Creative Commons license
Apache Maven
TO GO FURTHER …



   Licensed under a Creative Commons license
Apache Maven
DOCUMENTATIONS



   Licensed under a Creative Commons license
Some links
●    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




          Licensed under a Creative Commons license
Books
●    Sonatype / O’Reilly :
     -    The Definitive Guide
     -    http://www.sonatype.com/
          books
     -    Free download
     -    Available in several
          languages
            ●    Soon in French




          Licensed under a Creative Commons license
Books
●    Exist Global
     -    Better builds with Maven
     -    http://www.maestrodev.com/
          better-build-maven
     -    Free download




          Licensed under a Creative Commons license
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
     -    Available on 20th November




          Licensed under a Creative Commons license
Apache Maven
QUESTIONS ?



   Licensed under a Creative Commons license
Licence et copyrights
●    Photos and logos belong to their respective
     authors/owners
●    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/


          Licensed under a Creative Commons license

Más contenido relacionado

La actualidad más candente

Maven for Dummies
Maven for DummiesMaven for Dummies
Maven for DummiesTomer Gabel
 
Version Management in Maven
Version Management in MavenVersion Management in Maven
Version Management in MavenGeert Pante
 
Apache Maven for SoftServe IT Academy
Apache Maven for SoftServe IT AcademyApache Maven for SoftServe IT Academy
Apache Maven for SoftServe IT AcademyVolodymyr Ostapiv
 
An Introduction to Maven Part 1
An Introduction to Maven Part 1An Introduction to Maven Part 1
An Introduction to Maven Part 1MD Sayem Ahmed
 
Build Automation using Maven
Build Automation using Maven Build Automation using Maven
Build Automation using Maven Ankit Gubrani
 
Continuous Deployment Pipeline with maven
Continuous Deployment Pipeline with mavenContinuous Deployment Pipeline with maven
Continuous Deployment Pipeline with mavenAlan Parkinson
 
Lorraine JUG (1st June, 2010) - Maven
Lorraine JUG (1st June, 2010) - MavenLorraine JUG (1st June, 2010) - Maven
Lorraine JUG (1st June, 2010) - MavenArnaud Héritier
 
Apache Maven - eXo TN presentation
Apache Maven - eXo TN presentationApache Maven - eXo TN presentation
Apache Maven - eXo TN presentationArnaud Héritier
 
Maven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in MavenMaven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in MavenGeert Pante
 
Automated Deployment with Maven - going the whole nine yards
Automated Deployment with Maven - going the whole nine yardsAutomated Deployment with Maven - going the whole nine yards
Automated Deployment with Maven - going the whole nine yardsJohn Ferguson Smart Limited
 
Hands On with Maven
Hands On with MavenHands On with Maven
Hands On with MavenSid Anand
 

La actualidad más candente (20)

Maven for Dummies
Maven for DummiesMaven for Dummies
Maven for Dummies
 
Version Management in Maven
Version Management in MavenVersion Management in Maven
Version Management in Maven
 
Liferay maven sdk
Liferay maven sdkLiferay maven sdk
Liferay maven sdk
 
Apache Maven for SoftServe IT Academy
Apache Maven for SoftServe IT AcademyApache Maven for SoftServe IT Academy
Apache Maven for SoftServe IT Academy
 
An Introduction to Maven Part 1
An Introduction to Maven Part 1An Introduction to Maven Part 1
An Introduction to Maven Part 1
 
Introduction to maven
Introduction to mavenIntroduction to maven
Introduction to maven
 
Build Automation using Maven
Build Automation using Maven Build Automation using Maven
Build Automation using Maven
 
Continuous Deployment Pipeline with maven
Continuous Deployment Pipeline with mavenContinuous Deployment Pipeline with maven
Continuous Deployment Pipeline with maven
 
Maven
MavenMaven
Maven
 
Lorraine JUG (1st June, 2010) - Maven
Lorraine JUG (1st June, 2010) - MavenLorraine JUG (1st June, 2010) - Maven
Lorraine JUG (1st June, 2010) - Maven
 
Apache Maven
Apache MavenApache Maven
Apache Maven
 
Apache Maven - eXo TN presentation
Apache Maven - eXo TN presentationApache Maven - eXo TN presentation
Apache Maven - eXo TN presentation
 
Apache Maven In 10 Slides
Apache Maven In 10 SlidesApache Maven In 10 Slides
Apache Maven In 10 Slides
 
Maven
MavenMaven
Maven
 
Agile Software Development & Tools
Agile Software Development & ToolsAgile Software Development & Tools
Agile Software Development & Tools
 
Maven Overview
Maven OverviewMaven Overview
Maven Overview
 
Maven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in MavenMaven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in Maven
 
Apache Maven 2 Part 2
Apache Maven 2 Part 2Apache Maven 2 Part 2
Apache Maven 2 Part 2
 
Automated Deployment with Maven - going the whole nine yards
Automated Deployment with Maven - going the whole nine yardsAutomated Deployment with Maven - going the whole nine yards
Automated Deployment with Maven - going the whole nine yards
 
Hands On with Maven
Hands On with MavenHands On with Maven
Hands On with Maven
 

Destacado

Hands on iOS developments with jenkins
Hands on iOS developments with jenkinsHands on iOS developments with jenkins
Hands on iOS developments with jenkinsArnaud Héritier
 
2014 August - eXo Software Factory Overview
2014 August - eXo Software Factory Overview2014 August - eXo Software Factory Overview
2014 August - eXo Software Factory OverviewArnaud Héritier
 
CRaSH @ JUGSummerCamp 2012 - Quickie
CRaSH @ JUGSummerCamp 2012 - QuickieCRaSH @ JUGSummerCamp 2012 - Quickie
CRaSH @ JUGSummerCamp 2012 - QuickieArnaud Héritier
 
Java is evolving rapidly: Maven helps you staying on track
Java is evolving rapidly:  Maven helps you staying on trackJava is evolving rapidly:  Maven helps you staying on track
Java is evolving rapidly: Maven helps you staying on trackArnaud Héritier
 
LavaJUG-Maven 3.x, will it lives up to its promises
LavaJUG-Maven 3.x, will it lives up to its promisesLavaJUG-Maven 3.x, will it lives up to its promises
LavaJUG-Maven 3.x, will it lives up to its promisesArnaud Héritier
 
Sonar In Action 20110302-vn
Sonar In Action 20110302-vnSonar In Action 20110302-vn
Sonar In Action 20110302-vnArnaud Héritier
 
Quand java prend de la vitesse, apache maven vous garde sur les rails
Quand java prend de la vitesse, apache maven vous garde sur les railsQuand java prend de la vitesse, apache maven vous garde sur les rails
Quand java prend de la vitesse, apache maven vous garde sur les railsArnaud Héritier
 
Devops Recto-Verso @ DevoxxMA
Devops Recto-Verso @ DevoxxMADevops Recto-Verso @ DevoxxMA
Devops Recto-Verso @ DevoxxMAArnaud Héritier
 

Destacado (11)

Hands on iOS developments with jenkins
Hands on iOS developments with jenkinsHands on iOS developments with jenkins
Hands on iOS developments with jenkins
 
Demystifying Maven
Demystifying MavenDemystifying Maven
Demystifying Maven
 
2014 August - eXo Software Factory Overview
2014 August - eXo Software Factory Overview2014 August - eXo Software Factory Overview
2014 August - eXo Software Factory Overview
 
CRaSH @ JUGSummerCamp 2012 - Quickie
CRaSH @ JUGSummerCamp 2012 - QuickieCRaSH @ JUGSummerCamp 2012 - Quickie
CRaSH @ JUGSummerCamp 2012 - Quickie
 
Java is evolving rapidly: Maven helps you staying on track
Java is evolving rapidly:  Maven helps you staying on trackJava is evolving rapidly:  Maven helps you staying on track
Java is evolving rapidly: Maven helps you staying on track
 
LavaJUG-Maven 3.x, will it lives up to its promises
LavaJUG-Maven 3.x, will it lives up to its promisesLavaJUG-Maven 3.x, will it lives up to its promises
LavaJUG-Maven 3.x, will it lives up to its promises
 
Sonar In Action 20110302-vn
Sonar In Action 20110302-vnSonar In Action 20110302-vn
Sonar In Action 20110302-vn
 
Quand java prend de la vitesse, apache maven vous garde sur les rails
Quand java prend de la vitesse, apache maven vous garde sur les railsQuand java prend de la vitesse, apache maven vous garde sur les rails
Quand java prend de la vitesse, apache maven vous garde sur les rails
 
Devops Recto-Verso @ DevoxxMA
Devops Recto-Verso @ DevoxxMADevops Recto-Verso @ DevoxxMA
Devops Recto-Verso @ DevoxxMA
 
Maven Introduction
Maven IntroductionMaven Introduction
Maven Introduction
 
Continuous delivery-with-maven
Continuous delivery-with-mavenContinuous delivery-with-maven
Continuous delivery-with-maven
 

Similar a Maven for eXo VN

Apache Maven at GenevaJUG by Arnaud Héritier
Apache Maven at GenevaJUG by Arnaud HéritierApache Maven at GenevaJUG by Arnaud Héritier
Apache Maven at GenevaJUG by Arnaud HéritierGenevaJUG
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topicGourav Varma
 
Alfresco DevCon 2018: SDK 3 Multi Module project using Nexus 3 for releases a...
Alfresco DevCon 2018: SDK 3 Multi Module project using Nexus 3 for releases a...Alfresco DevCon 2018: SDK 3 Multi Module project using Nexus 3 for releases a...
Alfresco DevCon 2018: SDK 3 Multi Module project using Nexus 3 for releases a...Martin Bergljung
 
Maven 3 Overview
Maven 3  OverviewMaven 3  Overview
Maven 3 OverviewMike Ensor
 
Introduction to maven, its configuration, lifecycle and relationship to JS world
Introduction to maven, its configuration, lifecycle and relationship to JS worldIntroduction to maven, its configuration, lifecycle and relationship to JS world
Introduction to maven, its configuration, lifecycle and relationship to JS worldDmitry Bakaleinik
 
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...Sencha
 
Maven introduction in Mule
Maven introduction in MuleMaven introduction in Mule
Maven introduction in MuleShahid Shaik
 
Java Build Tools
Java Build ToolsJava Build Tools
Java Build Tools­Avishek A
 
Introduction to Maven for beginners and DevOps
Introduction to Maven for beginners and DevOpsIntroduction to Maven for beginners and DevOps
Introduction to Maven for beginners and DevOpsSISTechnologies
 
Extending Build to the Client: A Maven User's Guide to Grunt.js
Extending Build to the Client: A Maven User's Guide to Grunt.jsExtending Build to the Client: A Maven User's Guide to Grunt.js
Extending Build to the Client: A Maven User's Guide to Grunt.jsPetr Jiricka
 
Apache maven, a software project management tool
Apache maven, a software project management toolApache maven, a software project management tool
Apache maven, a software project management toolRenato Primavera
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulMert Çalışkan
 
BMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenBMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenMert Çalışkan
 

Similar a Maven for eXo VN (20)

Apache Maven at GenevaJUG by Arnaud Héritier
Apache Maven at GenevaJUG by Arnaud HéritierApache Maven at GenevaJUG by Arnaud Héritier
Apache Maven at GenevaJUG by Arnaud Héritier
 
Maven
MavenMaven
Maven
 
Maven
MavenMaven
Maven
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topic
 
Alfresco DevCon 2018: SDK 3 Multi Module project using Nexus 3 for releases a...
Alfresco DevCon 2018: SDK 3 Multi Module project using Nexus 3 for releases a...Alfresco DevCon 2018: SDK 3 Multi Module project using Nexus 3 for releases a...
Alfresco DevCon 2018: SDK 3 Multi Module project using Nexus 3 for releases a...
 
Maven 3 Overview
Maven 3  OverviewMaven 3  Overview
Maven 3 Overview
 
4 maven junit
4 maven junit4 maven junit
4 maven junit
 
Introduction to maven, its configuration, lifecycle and relationship to JS world
Introduction to maven, its configuration, lifecycle and relationship to JS worldIntroduction to maven, its configuration, lifecycle and relationship to JS world
Introduction to maven, its configuration, lifecycle and relationship to JS world
 
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
 
Maven
MavenMaven
Maven
 
Maven introduction in Mule
Maven introduction in MuleMaven introduction in Mule
Maven introduction in Mule
 
Java Build Tools
Java Build ToolsJava Build Tools
Java Build Tools
 
Introduction to Maven for beginners and DevOps
Introduction to Maven for beginners and DevOpsIntroduction to Maven for beginners and DevOps
Introduction to Maven for beginners and DevOps
 
Extending Build to the Client: A Maven User's Guide to Grunt.js
Extending Build to the Client: A Maven User's Guide to Grunt.jsExtending Build to the Client: A Maven User's Guide to Grunt.js
Extending Build to the Client: A Maven User's Guide to Grunt.js
 
Session 2
Session 2Session 2
Session 2
 
Session 2
Session 2Session 2
Session 2
 
Apache maven, a software project management tool
Apache maven, a software project management toolApache maven, a software project management tool
Apache maven, a software project management tool
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
 
BMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenBMO - Intelligent Projects with Maven
BMO - Intelligent Projects with Maven
 
Manen Ant SVN
Manen Ant SVNManen Ant SVN
Manen Ant SVN
 

Más de Arnaud Héritier

eXo Software Factory Overview
eXo Software Factory OvervieweXo Software Factory Overview
eXo Software Factory OverviewArnaud Héritier
 
Mobile developments at eXo
Mobile developments at eXoMobile developments at eXo
Mobile developments at eXoArnaud Héritier
 
Jenkins User Meetup - eXo usages of Jenkins
Jenkins User Meetup - eXo usages of JenkinsJenkins User Meetup - eXo usages of Jenkins
Jenkins User Meetup - eXo usages of JenkinsArnaud Héritier
 
ToursJUG-Maven 3.x, will it lives up to its promises
ToursJUG-Maven 3.x, will it lives up to its promisesToursJUG-Maven 3.x, will it lives up to its promises
ToursJUG-Maven 3.x, will it lives up to its promisesArnaud Héritier
 
YaJUG-Maven 3.x, will it lives up to its promises
YaJUG-Maven 3.x, will it lives up to its promisesYaJUG-Maven 3.x, will it lives up to its promises
YaJUG-Maven 3.x, will it lives up to its promisesArnaud Héritier
 
BordeauxJUG-Maven 3.x, will it lives up to its promises
BordeauxJUG-Maven 3.x, will it lives up to its promisesBordeauxJUG-Maven 3.x, will it lives up to its promises
BordeauxJUG-Maven 3.x, will it lives up to its promisesArnaud Héritier
 
ToulouseJUG-Maven 3.x, will it lives up to its promises
ToulouseJUG-Maven 3.x, will it lives up to its promisesToulouseJUG-Maven 3.x, will it lives up to its promises
ToulouseJUG-Maven 3.x, will it lives up to its promisesArnaud Héritier
 
Apache Maven - eXo VN office presentation
Apache Maven - eXo VN office presentationApache Maven - eXo VN office presentation
Apache Maven - eXo VN office presentationArnaud Héritier
 
LyonJUG - Maven 3.x, will it live up to its promises?
LyonJUG - Maven 3.x, will it live up to its promises?LyonJUG - Maven 3.x, will it live up to its promises?
LyonJUG - Maven 3.x, will it live up to its promises?Arnaud Héritier
 
20091112 - Mars Jug - Apache Maven
20091112 - Mars Jug - Apache Maven20091112 - Mars Jug - Apache Maven
20091112 - Mars Jug - Apache MavenArnaud Héritier
 
20080311 - Paris Vi Master STL TA - Initiation Maven
20080311 - Paris Vi Master STL TA - Initiation Maven20080311 - Paris Vi Master STL TA - Initiation Maven
20080311 - Paris Vi Master STL TA - Initiation MavenArnaud Héritier
 
20081008 - Tours Jug - Apache Maven
20081008  - Tours Jug - Apache Maven20081008  - Tours Jug - Apache Maven
20081008 - Tours Jug - Apache MavenArnaud Héritier
 
20081023 - Paris Vi Master STL TA - Initiation Maven
20081023 - Paris Vi Master STL TA - Initiation Maven20081023 - Paris Vi Master STL TA - Initiation Maven
20081023 - Paris Vi Master STL TA - Initiation MavenArnaud Héritier
 
20080513 - Paris Jug - Maven à La Demande
20080513 - Paris Jug - Maven à La Demande20080513 - Paris Jug - Maven à La Demande
20080513 - Paris Jug - Maven à La DemandeArnaud Héritier
 
20081113 - Nantes Jug - Apache Maven
20081113 - Nantes Jug - Apache Maven20081113 - Nantes Jug - Apache Maven
20081113 - Nantes Jug - Apache MavenArnaud Héritier
 
20091020 - Normandy Jug - Builders Battle
20091020 - Normandy Jug - Builders Battle20091020 - Normandy Jug - Builders Battle
20091020 - Normandy Jug - Builders BattleArnaud Héritier
 

Más de Arnaud Héritier (16)

eXo Software Factory Overview
eXo Software Factory OvervieweXo Software Factory Overview
eXo Software Factory Overview
 
Mobile developments at eXo
Mobile developments at eXoMobile developments at eXo
Mobile developments at eXo
 
Jenkins User Meetup - eXo usages of Jenkins
Jenkins User Meetup - eXo usages of JenkinsJenkins User Meetup - eXo usages of Jenkins
Jenkins User Meetup - eXo usages of Jenkins
 
ToursJUG-Maven 3.x, will it lives up to its promises
ToursJUG-Maven 3.x, will it lives up to its promisesToursJUG-Maven 3.x, will it lives up to its promises
ToursJUG-Maven 3.x, will it lives up to its promises
 
YaJUG-Maven 3.x, will it lives up to its promises
YaJUG-Maven 3.x, will it lives up to its promisesYaJUG-Maven 3.x, will it lives up to its promises
YaJUG-Maven 3.x, will it lives up to its promises
 
BordeauxJUG-Maven 3.x, will it lives up to its promises
BordeauxJUG-Maven 3.x, will it lives up to its promisesBordeauxJUG-Maven 3.x, will it lives up to its promises
BordeauxJUG-Maven 3.x, will it lives up to its promises
 
ToulouseJUG-Maven 3.x, will it lives up to its promises
ToulouseJUG-Maven 3.x, will it lives up to its promisesToulouseJUG-Maven 3.x, will it lives up to its promises
ToulouseJUG-Maven 3.x, will it lives up to its promises
 
Apache Maven - eXo VN office presentation
Apache Maven - eXo VN office presentationApache Maven - eXo VN office presentation
Apache Maven - eXo VN office presentation
 
LyonJUG - Maven 3.x, will it live up to its promises?
LyonJUG - Maven 3.x, will it live up to its promises?LyonJUG - Maven 3.x, will it live up to its promises?
LyonJUG - Maven 3.x, will it live up to its promises?
 
20091112 - Mars Jug - Apache Maven
20091112 - Mars Jug - Apache Maven20091112 - Mars Jug - Apache Maven
20091112 - Mars Jug - Apache Maven
 
20080311 - Paris Vi Master STL TA - Initiation Maven
20080311 - Paris Vi Master STL TA - Initiation Maven20080311 - Paris Vi Master STL TA - Initiation Maven
20080311 - Paris Vi Master STL TA - Initiation Maven
 
20081008 - Tours Jug - Apache Maven
20081008  - Tours Jug - Apache Maven20081008  - Tours Jug - Apache Maven
20081008 - Tours Jug - Apache Maven
 
20081023 - Paris Vi Master STL TA - Initiation Maven
20081023 - Paris Vi Master STL TA - Initiation Maven20081023 - Paris Vi Master STL TA - Initiation Maven
20081023 - Paris Vi Master STL TA - Initiation Maven
 
20080513 - Paris Jug - Maven à La Demande
20080513 - Paris Jug - Maven à La Demande20080513 - Paris Jug - Maven à La Demande
20080513 - Paris Jug - Maven à La Demande
 
20081113 - Nantes Jug - Apache Maven
20081113 - Nantes Jug - Apache Maven20081113 - Nantes Jug - Apache Maven
20081113 - Nantes Jug - Apache Maven
 
20091020 - Normandy Jug - Builders Battle
20091020 - Normandy Jug - Builders Battle20091020 - Normandy Jug - Builders Battle
20091020 - Normandy Jug - Builders Battle
 

Último

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Último (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Maven for eXo VN

  • 1. Apache Maven @ eXo Platform Hanoï – 09 Feb 2010 Arnaud Héritier eXo Platform Software Factory Manager
  • 2. Apache Maven OVERVIEW Licensed under a Creative Commons license
  • 3. Apache Maven BASICS Licensed under a Creative Commons license 3
  • 4. Definition ●  Apache Maven is a software project management and comprehension tool. ●  Based on the concept of a project object model (POM), Maven can manage a project's build, binaries, reporting and documentation from a central piece of information. ●  Apache Maven is a command line tool with some IDE integrations. Licensed under a Creative Commons license
  • 5. Conventions ●  1 project = 1 artifact (pom, jar, war, ear, …) ●  Standardized -  directories layout -  project descriptor (POM) -  build lifecycle Licensed under a Creative Commons license 5
  • 6. POM ●  An XML file (pom.xml) <?xml version="1.0" encoding="UTF-8"?>! <project>! <modelVersion>4.0.0</modelVersion>! <groupId>org.apache.maven</groupId>! ●  Describing <artifactId>webapp-sample</artifactId>! <version>1.1-SNAPSHOT</version>! -  Project identification <packaging>war</packaging>! <name>Simple webapp</name>! -  Project version <inceptionYear>2007</inceptionYear>! -  Project description <dependencies>! <dependency>! -  Build settings <groupId>org.springframework</groupId>! -  Dependencies <artifactId>spring-struts</artifactId>! <version>2.0.2</version>! -  … </dependency>! ...! </dependencies>! </project>! Licensed under a Creative Commons license
  • 7. Dependencies Without Maven With Maven Licensed under a Creative Commons license
  • 8. Dependencies ●  Declaratives -  groupId + artifactId + version (+ classifier) -  Type (packaging) : jar, war, pom, ear, … ●  Transitives -  Lib A needs Lib B -  Lib B needs Lib C -  Thus Lib A needs Lib C Licensed under a Creative Commons license
  • 9. Dependencies ●  Scope -  Compile (by default) : Required to build and run the application -  Runtime : not required to build the application but needed at runtime ●  Ex : taglibs -  Provided : required to build the application but not needed at runtime (provided by the container) ●  Ex : Servlet API, Driver SGBD, … -  Test : required to build and launch tests but not needed by the application itself to build and run ●  Ex : Junit, TestNG, DbUnit, … -  System : local library with absolute path ●  Ex : software products Licensed under a Creative Commons license
  • 10. Dependencies ●  Define all dependencies you are using -  and no more ! ●  Cleanup your dependencies with -  mvn dependency:analyze! ●  Study your dependencies with -  mvn dependency:tree! -  mvn dependency:list! Licensed under a Creative Commons license
  • 11. Artifact Repository ●  By default : -  A central repository ●  http://repo1.maven.org/ maven2 ●  Several dozen of Gb of OSS libraries -  A local repository ●  ${user.home}/.m2/repository ●  All artifacts -  Used by maven and its plugins -  Used by your projects (dependencies) -  Produced by your projects Licensed under a Creative Commons license
  • 12. Artifact Repository ●  By default Maven downloads artifacts required by the project or itself from central ●  Downloaded artifacts are stored in the local repository Licensed under a Creative Commons license
  • 13. Versions ●  Project and dependency versions ●  Two different version variants   SNAPSHOT version ●  The version number ends with –SNAPSHOT ●  The project is in development ●  Deliveries are changing over the time and are overridden after each build ●  Artifacts are deployed with a timestamp on remote repositories   RELEASE version ●  The version number doesn’t end with –SNAPSHOT ●  Binaries won’t change Licensed under a Creative Commons license
  • 14. Versions Licensed under a Creative Commons license
  • 15. Versions ●  About SNAPSHOT dependencies -  Maven allows the configuration of an update policy. The update policy defines the recurrence of checks if there is a new SNAPSHOT version available on the remote repository : ●  always ●  daily (by default) ●  interval:X (a given period in minutes) ●  never -  Must not be used in a released project ●  They can change thus the release also  ●  The release plugin will enforce it  Licensed under a Creative Commons license
  • 16. Versions ●  Use the versions plugin to update all versions in all POMs -  mvn versions:set 
 –DnewVersion=A.B.C-SNAPSHOT! Licensed under a Creative Commons license
  • 17. Profiles ●  Allow to modify the default behavior of Maven by overriding/adding some settings ●  Use mvn help:active-profiles to debug ●  Explicit activation or deactivation mvn <phases or goals> ! -PprofileId1,-profileId2 ! -P!profileId3! Licensed under a Creative Commons license
  • 18. Profiles ●  activeByDefault = If no other profile is activated ●  Activation through Maven settings <settings>! ...! <activeProfiles>! <activeProfile>profile-1</activeProfile>! </activeProfiles>! ...! </settings>! Licensed under a Creative Commons license
  • 19. Profiles ●  Activation based on environment variables <profiles>! <profiles>! <profile>! <profile>! <activation>! <activation>! <property>! <property>! <name>!skip-enforce</name>! <name>run-its</name>! </property>! <value>true</value>! </activation>! </property>! ...! </activation>! </profile>! ...! </profiles>! </profile>! </profiles>! Licensed under a Creative Commons license
  • 20. Profiles ●  OS / Java settings <profiles>! <profiles>! <profile>! <profile>! <activation>! <activation>! <os>! <jdk>[1.3,1.6)</jdk>! <name>Windows XP</name>! </activation>! <family>Windows</family>! ...! <arch>x86</arch>! </profile>! <version>5.1.2600</version>! </profiles>! </os>! </activation>! ...! </profile>! </profiles>! Licensed under a Creative Commons license
  • 21. Profiles ●  Activation on present or missing files <profiles>! <profile>! <activation>! <file>! <missing>${project.build.directory}/generated-sources/ axistools/wsdl2java/org/apache/maven</missing>! </file>! </activation>! ...! </profile>! </profiles>! Licensed under a Creative Commons license
  • 22. Reactor ●  Ability of Maven to build pom.xml : several sub-modules <modules> resolving the order of their <module>moduleA</module> dependencies <module>moduleC</module> ●  Modules have to be <module>moduleB</module> defined in the POM </modules> -  For a performance reasons Licensed under a Creative Commons license
  • 23. Inheritence ●  Share settings between projects/modules ●  Project -  Business1 ●  Jar ●  War -  Business2 ●  Jar pom.xml for module Jar1 ●  War <parent> ●  By default the parent <groupId>X.Y.Z</groupId> project is supposed to be <artifactId>jars</artifactId> in the parent directory <version>1.0-SNAPSHOT<version> (../) </parent> Licensed under a Creative Commons license
  • 24. Build Lifecycle And Plugins ●  Plugin based architecture for a great extensibility ●  Standardized lifecycle to build all types of archetypes Licensed under a Creative Commons license
  • 25. Apache Maven GOOD & BAD PRACTICES Licensed under a Creative Commons license
  • 26. Apache Maven KISS Licensed under a Creative Commons license
  • 27. K.I.S.S. ●  Keep It Simple, Stupid ●  Start from scratch -  Do not copy/paste what you find without understanding ●  Use only what you need -  It’s not because maven offers many features that you need to use them ●  Filtering ●  Modules ●  Profiles ●  … Licensed under a Creative Commons license
  • 28. Apache Maven PROJECT ORGANIZATION GOOD & BAD PRACTICES Licensed under a Creative Commons license
  • 29. Project bad practices ●  Ignore Maven conventions -  Except if your are migrating from something else and the target has to be to follow them. -  Except if they are not compatible with your IDE ●  Different versions in sub-modules -  In that case they are standalone projects. ●  Too many inheritance levels -  It makes the POMs maintenance more complex -  Where should I set this plugin parameter ? In which parent ? Licensed under a Creative Commons license
  • 30. Project bad practices ●  Have too many modules -  Is there a good reason ? ●  Technical constraint ? ●  Team organization ? -  It increases the build time ●  Many more artifacts to generate ●  Dependencies resolution more complex -  It involves more complex developments ●  More modules to import in your IDE ●  More modules to update … Licensed under a Creative Commons license
  • 31. Project good practices ●  Use the default inheritance : -  The reactor project is also the parent of its modules. -  Configuration is easier : ●  No need to redefine SCM settings, site distribution settings … Licensed under a Creative Commons license
  • 32. Apache Maven POM GOOD & BAD PRACTICES Licensed under a Creative Commons license
  • 33. POM bad practices ●  Dependencies : -  DON’T confuse dependencies and dependencyManagement ●  Plugins : -  DON’T confuse plugins and pluginManagement -  DON’T use AntRun plugin everywhere -  DON’T let Maven choose plugins versions for you Licensed under a Creative Commons license
  • 34. POM bad practices ●  Profiles : -  DON’T create environment dependant builds -  DON’T rely on dependencies coming from profiles (there is no transitive activation of profiles) ●  Reporting and quality -  DON’T activate on an existing project all reports with default configuration -  DON’T control formatting rules without giving settings for IDEs. ●  DON’T put everything you find in your POM. Licensed under a Creative Commons license
  • 35. POM good practices ●  Set versions of dependencies in project parent’s dependencyManagement ●  Set dependencies (groupId, artifactId, scope) in each module they are used ●  Use the dependency plugin (from apache) and versions plugin (from mojo) to analyze, cleanup and update your dependencies. Licensed under a Creative Commons license
  • 36. Apache Maven DEVELOPMENT GOOD & BAD PRACTICES Licensed under a Creative Commons license
  • 37. Development bad practices ●  DON’T spend your time in the terminal, ●  DON’T exchange libraries through emails, ●  DON’T always use "-Dmaven.test.skip=true” ●  DON’T manually do releases Licensed under a Creative Commons license
  • 38. Development good practices ●  Keep up-to-date your version of Maven -  For example in 2.1 the time of dependencies/modules resolution decreased a lot (Initialization of a project of 150 modules passed from 8 minutes to less than 1) ●  Use the reactor plugin (Maven < 2.1) or native reactor command line options (Maven >= 2.1) to rebuild only a subpart of your project : -  All modules depending on module XXX -  All modules used to build XXX ●  Try to not use Maven features not supported by your IDE (resources filtering with the plugin eclipse:eclipse) Licensed under a Creative Commons license
  • 39. Apache Maven TO GO FURTHER … Licensed under a Creative Commons license
  • 40. Apache Maven DOCUMENTATIONS Licensed under a Creative Commons license
  • 41. Some links ●  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 Licensed under a Creative Commons license
  • 42. Books ●  Sonatype / O’Reilly : -  The Definitive Guide -  http://www.sonatype.com/ books -  Free download -  Available in several languages ●  Soon in French Licensed under a Creative Commons license
  • 43. Books ●  Exist Global -  Better builds with Maven -  http://www.maestrodev.com/ better-build-maven -  Free download Licensed under a Creative Commons license
  • 44. 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 -  Available on 20th November Licensed under a Creative Commons license
  • 45. Apache Maven QUESTIONS ? Licensed under a Creative Commons license
  • 46. Licence et copyrights ●  Photos and logos belong to their respective authors/owners ●  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/ Licensed under a Creative Commons license