SlideShare a Scribd company logo
Apache Maven 2 Overview
                                                         Part 2

                                        Advanced Topics of Apache Maven 2


                                                          Anatoly Kondratyev
                                                            September 2012


30 January 2013
             Exigen Services confidential                   Exigen Services confidential
The Goal




•   Understand several Maven capabilities
•   Build multi-module project with Maven
•   Some special pom blocks
•   Nexus configuration notes



        Exigen Services confidential        2
Maven in real world

      WORKING WITH MULTI-MODULE
                      PROJECTS


Exigen Services confidential                     3
Project contents

                 GWT
               application




                                     EJB A   EJB B



                 My Library




      Exigen Services confidential                   4
What to do with Maven?

• 4 independent artifacts with dependencies
  •   Build in one step?
  •   Organize versioning?
  •   Keeping up to date?
  •   Wrong!
• Maven Inheritance and Aggregation
  • Solves the above problems
  • Right!


        Exigen Services confidential          5
Maven Inheritance & Aggregation


•   <packaging>pom</packaging>
•   Super pom
•   Data in parent pom is inherited
•   Maven dependency reactor
•   Notes
    • No cyclic dependencies
    • No same modules


        Exigen Services confidential   6
Maven Inheritance & Aggregation




                                     Parent
                                           pom


 EJB A                  EJB B                 Gwt         My library
         ejb                         ejb            war            jar




      Exigen Services confidential                                     7
Maven in action
<project …>
    <modelVersion>4.0.0</modelVersion>
    <groupId>ru.exigenservices</groupId>
    <artifactId>my-parent</artifactId>
    <version>1.0.1-SNAPSHOT</version>
    <packaging>pom</packaging>

    <modules>
        <module>EJB-A</module>
        <module>EJB-B</module>
        <module>Gwt</module>
        <module>MyLibrary</module>
    </modules>
</project>

         Exigen Services confidential      8
Maven in action




• What about deployment?
  • EAR needed
  • Special step needed
• Maybe divide frontend and backend?
• NB! One pom – one artifact



      Exigen Services confidential     9
Maven in action




                                       Parent
                                              pom


       Frontend                                             Backend
                 pom                                                    pom


                 Frontend                                                Backend
 Gwt                                        EJB A         EJB B                          My library
                 wrapper                                                 wrapper                 jar
       war                  ear                     ejb           ejb              ear




             Exigen Services confidential                                                        10
Multimodal hierarchy
                                •    Parent pom
                                <project …>
                                       <groupId>exigen</groupId>
                                       <artifactId>parent</artifactId>
                                       <version>1.0.1-SNAPSHOT</version>
                                       <packaging>pom</packaging>
                                       <modules>
                                              <module>backend</module>
                                              <module>frontend</module>
                                       </modules>
                                </project>
                                •    Frontend pom
                                <project …>
                                       <parent>
                                              <groupId>exigen</groupId>
                                              <artifactId>parent</artifactId>
                                              <version>1.0.1-SNAPSHOT</version>
                                       </parent>
                                       <artifactId>frontend</artifactId>
                                       <packaging>pom</packaging>
                                       <modules>
                                              <module>Gwt</module>
                                       </modules>
                                </project>




      Exigen Services confidential                                                11
Dependency&Plugin management


• Changeable, overriddable and inheritable
• In parent
  • GroupId & ArtifactId
  • Version
  • Everything you can configure
     • Type, packaging
• In child
  • GroupId & ArtifactId

       Exigen Services confidential          12
Dependency&Plugin Management
Parent:
<dependencyManagement>
   <dependencies>
    <dependency>
         <groupId>javax</groupId>
         <artifactId>javaee-api</artifactId>
         <version>6.0</version>
         <scope>provided</scope>
    </dependency>
   </dependencies>
</dependencyManagement>


Child:
<dependencies>
    <dependency>
         <groupId>javax</groupId>
         <artifactId>javaee-api</artifactId>
    </dependency>
</dependencies>


           Exigen Services confidential        13
Flat vs Tree, Flat

   .
   |-- my-module
   | `-- pom.xml
   `--parent
       `--pom.xml

• Pom.xml for my-module:
  <project>
   <parent>
        <groupId>com.mycompany.app</groupId>
        <artifactId>my-app</artifactId>
        <version>1</version>
        <relativePath>.../parent/pom.xml</relativePath>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>my-module</artifactId>
  </project>


         Exigen Services confidential                     15
Maven reactor


• Collects all the available modules to build
• Sorts the projects into the correct build order
   • a project dependency on another module in the build
   • different rules with plugins dependencies
   • the order declared in the <modules> element (if no other rule
     applies)
• Builds the selected projects in order
• Be aware of cycles and same modules on different
  parents




         Exigen Services confidential                                16
Conclusion



•   Inheritance and aggregation
•   Flat/Tree structure
•   Maven reactor
•   Dependency&Plugin management
•   Deploy to Nexus/Weblogic problem



        Exigen Services confidential   17
What will help you

                           PROPERTIES, PROFILES,
                              EXECUTION BLOCKS


Exigen Services confidential                         18
Maven properties



• Just as common Ant properties
• ${property_name}
• Case sensitive
  • Upper case for environment variables
• Dot(.) notated path




      Exigen Services confidential         19
Predefined properties
• Build in properties
   • ${basedir} – directory with pom
   • ${version} – artifact version
• Project properties
   •   ${project.build.directory}
   •   ${project.build.outputDirectory} (target/classes)
   •   ${project.name}
   •   ${project.version}
• Local user settings
   • ${settings.localRepository}
• Environment properties
   •   ${env.M2_HOME}



           Exigen Services confidential                    20
Maven profiles


• Maven profile – special way for configuring
  build
• Different environments – different results
  • Renaming
  • Different build cycles
  • Special plugin configuration
• Just different targets
• For different users

       Exigen Services confidential         22
Maven profiles



• Per project
  • pom.xml
• Per user
  • %USER_HOME%/.m2/settings.xml
• Per computer (Global)
  • %M2_HOME%/conf/settings.xml



      Exigen Services confidential   23
Maven profiles



• Activation
  • By hand (-P profile1,profile2)
  • <activeProfiles>
  • <activation>
     • By environment settings
     • By properties




      Exigen Services confidential   24
Maven profiles
<profiles>
   <profile>
    <activation>
        <jdk>[1.3,1.6)</jdk>
    </activation>
   ...
   </profile>
   <profile>
    <activation>
        <property>
            <name>environment</name>
            <value>test</value>
        </property>
    </activation>
   ...
   </profile>
</profiles>

         Exigen Services confidential   25
Mojo


• Plugin
  • Executing action
• Mojo – magical charm in hoodoo
  •   Just a Goal
  •   Plugin consists of Mojos
  •   Some parameters
  •   MOJO aka POJO (Plain-old-Java-object)


        Exigen Services confidential          27
Mojo



• When we should use mojos?
• Run from command line
• Different execution parameters for different
  configurations
• Group of mojos from same plugin with
  different configuration


       Exigen Services confidential          28
Execution blocks
Plugin:time

<plugin>
    <groupId>com.mycompany.example</groupId>
    <artifactId>plugin</artifactId>
    <version>1.0</version>
    <executions>
     <execution>
          <id>first</id>
          <phase>test</phase>
          <goals>
               <goal>time</goal>
          </goals>
          <configuration> … </configuration>
     </execution>
     <execution>
          <id>default</id>
          …
          <!– No phase block -->
     </execution>
    </executions>
</plugin>



              Exigen Services confidential     29
SCM SourceCodeManagement

•   CVS, Mercurial, Perforce, Subversion, etc.
•   Commit/update
•   scm:bootstrap – build project
•   Maven Release Plugin
    • Snapshot  Version
    • Check everything
    • Commit



        Exigen Services confidential         30
Maven archetypes

• Create folders, poms, general stuff
• Archetype  Project
• For creating project:
  • archetype:generate
     • Select archetype from list
     • Set up groupId, artifactId, version, …
     • Get all project structure and draft files
  • maven-archetype-quickstart
• For creating archetype:
  • archetype:create-from-project


       Exigen Services confidential                31
Provided Arhetypes

• maven-archetype-archetype
   • Sample archetype
• maven-archetype-j2ee-simple
   • Simplified sample J2EE application
• maven-archetype-plugin
   • Sample Maven plugin
• maven-archetype-quickstart
   •   Sample Maven project
• maven-archetype-webapp
   • Sample Maven Webapp project
• More information:
  http://maven.apache.org/archetype/maven-archetype-bundles/


          Exigen Services confidential                         32
archetype:create-from-project

• Sample project
• mvn archetype:create-from-project
   • src catalog
   • Pom.xml (maven-archetype)
   • Some resources
• Modify code (…targetgenerated-sourcesarchetype)
   • archetype-metadata.xml
   • Update properties and default values; review
• Go to target, run “mvn install”
• To test archetype
   “mvn archetype:generate -DarchetypeCatalog=local”



         Exigen Services confidential                  33
Good configuration - great advantage

                                                NEXUS
                                          SETTING.XML


Exigen Services confidential                                34
Sonatype Nexus

•   Artifact repository
•   Nexus and Nexus Pro
•   Rather simple
•   Widely used

• Other Maven Repository Managers
    • Apache Archiva
    • Artifactory
    • Comparison
      http://docs.codehaus.org/display/MAVENUSER/Maven+Repository+Manager+Fe
      ature+Matrix


          Exigen Services confidential                                    35
Nexus hints



• Nexus configuration + local configuration
• Proxy repositories
  • Add everything and cache it!
  • Add to Public Repositories group
• Restrictions on uploading artifacts
  • UI: Artifact Upload



      Exigen Services confidential            36
Settings.xml
• Servers                                                      • Profile
   <servers>
                                                                 <profiles>
    <server>
                                                                  <profile>
          <id>nexus</id>
                                                                   <id>nexus</id>
          <username>…</username>
                                                                   <repositories>
          <password>…</password>
                                                                     <repository>
    </server>
                                                                       <id>central</id>
   </servers>
                                                                       <url>http://central</url>
• Mirrors (2.0.9)                                                      <releases>
   <mirrors>                                                             <enabled>true</enabled>
    <mirror>                                                             <updatePolicy>never</updatePolicy>
           <id>nexus</id>                                              </releases>
           <mirrorOf>*</mirrorOf>                                      <snapshots>
   <url>http://localserver:8081/nexus/content/groups/public/                  <enabled>true</enabled>
   </url>                                                              </snapshots>
     </mirror>                                                       </repository>
    </mirrors>                                                      </repositories>

• Active Profile                                                    <pluginRepositories>
    <activeProfiles>                                                     …
                                                                    </pluginRepositories>
          <activeProfile>nexus</activeProfile>
                                                                   </profile>
    </activeProfiles>
                                                                 </profiles>


                Exigen Services confidential                                                            37
updatePolicy


• UpdatePolicy
  •   Always
  •   Daily (default)
  •   Interval:X (X – integer in minutes)
  •   Never
• Repository Snapshots
  • Enabled true/false


        Exigen Services confidential        38
When you have free time…

LICENSE, ORGANIZATION, DEVELOPER
                 S, CONTRIBUTORS


   Exigen Services confidential                         39
Licenses

• How your project could be used?



<licenses>
  <license>
   <name>The Apache Software License, Version 2.0</name>
   <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
   <distribution>repo</distribution>
   <comments>A business-friendly OSS license</comments>
  </license>
</licenses>


         Exigen Services confidential                          40
Organization


• Just tell everybody!



<organization>
  <name>Exigen Services</name>
  <url>http://www.exigenservices.ru/</url>
</organization>




      Exigen Services confidential           41
Developers & Contributors block


•   Id, name, email
•   Organization, organizationUrl
•   Roles
•   Timezone
•   Properties

• Contributors don’t have Id

        Exigen Services confidential   42
Developers block
<developers>
 <developer>
    <id>anatoly.k</id>
    <name>Anatoly</name>
    <email>Anatoly.Kondratiev@exigenservices.com</email>
    <organization>Exigen</organization>
    <organizationUrl>http://www.exigenservices.ru/</organizationUrl>
    <roles>
         <role>Configuration Manager</role>
         <role>Developer</role>
    </roles>
    <timezone>+3</timezone>
    <properties>
         <skype>anatoly.kondratyev</skype>
    </properties>
 </developer>
</developers>


           Exigen Services confidential
Final notes




• A great amount of plugins
• Ant-run
• Mirrors on local repo, not on computer




      Exigen Services confidential         44
Now it’s your turn…

                                QUESTIONS



Exigen Services confidential                    45

More Related Content

What's hot

Introduction in Apache Maven2
Introduction in Apache Maven2Introduction in Apache Maven2
Introduction in Apache Maven2
Heiko Scherrer
 
Lorraine JUG (1st June, 2010) - Maven
Lorraine JUG (1st June, 2010) - MavenLorraine JUG (1st June, 2010) - Maven
Lorraine JUG (1st June, 2010) - Maven
Arnaud Héritier
 
Tools Coverage for the Java EE Platform @ Silicon Valley Code Camp 2010
Tools Coverage for the Java EE Platform @ Silicon Valley Code Camp 2010Tools Coverage for the Java EE Platform @ Silicon Valley Code Camp 2010
Tools Coverage for the Java EE Platform @ Silicon Valley Code Camp 2010
Arun Gupta
 
Getting Started with Rails on GlassFish (Hands-on Lab) - Spark IT 2010
Getting Started with Rails on GlassFish (Hands-on Lab) - Spark IT 2010Getting Started with Rails on GlassFish (Hands-on Lab) - Spark IT 2010
Getting Started with Rails on GlassFish (Hands-on Lab) - Spark IT 2010
Arun Gupta
 
Liferay maven sdk
Liferay maven sdkLiferay maven sdk
Liferay maven sdk
Mika Koivisto
 
Deep Dive Hands-on in Java EE 6 - Oredev 2010
Deep Dive Hands-on in Java EE 6 - Oredev 2010Deep Dive Hands-on in Java EE 6 - Oredev 2010
Deep Dive Hands-on in Java EE 6 - Oredev 2010
Arun Gupta
 
Drupal 8. What's cooking (based on Angela Byron slides)
Drupal 8. What's cooking (based on Angela Byron slides)Drupal 8. What's cooking (based on Angela Byron slides)
Drupal 8. What's cooking (based on Angela Byron slides)
Claudiu Cristea
 
Maven for eXo VN
Maven for eXo VNMaven for eXo VN
Maven for eXo VN
Arnaud Héritier
 
Magnolia CMS 5.0 - UI Architecture
Magnolia CMS 5.0 - UI ArchitectureMagnolia CMS 5.0 - UI Architecture
Magnolia CMS 5.0 - UI ArchitecturePhilipp Bärfuss
 
Glass Fishv3 March2010
Glass Fishv3 March2010Glass Fishv3 March2010
Glass Fishv3 March2010
Stephan Janssen
 
Apache Maven - eXo TN presentation
Apache Maven - eXo TN presentationApache Maven - eXo TN presentation
Apache Maven - eXo TN presentation
Arnaud Héritier
 
GWT Overview And Feature Preview - SV Web JUG - June 16 2009
GWT Overview And Feature Preview - SV Web JUG -  June 16 2009GWT Overview And Feature Preview - SV Web JUG -  June 16 2009
GWT Overview And Feature Preview - SV Web JUG - June 16 2009
Fred Sauer
 
Tuscany : Applying OSGi After The Fact
Tuscany : Applying  OSGi After The FactTuscany : Applying  OSGi After The Fact
Tuscany : Applying OSGi After The Fact
Luciano Resende
 
Maven, Eclipse and OSGi Working Together - Carlos Sanchez
Maven, Eclipse and OSGi Working Together - Carlos SanchezMaven, Eclipse and OSGi Working Together - Carlos Sanchez
Maven, Eclipse and OSGi Working Together - Carlos Sanchez
mfrancis
 
Powering the Next Generation Services with Java Platform - Spark IT 2010
Powering the Next Generation Services with Java Platform - Spark IT 2010Powering the Next Generation Services with Java Platform - Spark IT 2010
Powering the Next Generation Services with Java Platform - Spark IT 2010
Arun Gupta
 
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3 Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Skills Matter
 
Java 7 Modularity: a View from the Gallery
Java 7 Modularity: a View from the GalleryJava 7 Modularity: a View from the Gallery
Java 7 Modularity: a View from the Gallerynjbartlett
 
Magnolia CMS 5.0 - Overview
Magnolia CMS 5.0 - OverviewMagnolia CMS 5.0 - Overview
Magnolia CMS 5.0 - OverviewPhilipp Bärfuss
 
Java EE 6 and GlassFish v3: Paving the path for future
Java EE 6 and GlassFish v3: Paving the path for futureJava EE 6 and GlassFish v3: Paving the path for future
Java EE 6 and GlassFish v3: Paving the path for future
Arun Gupta
 
The Dolphins Leap Again
The Dolphins Leap AgainThe Dolphins Leap Again
The Dolphins Leap Again
Ivan Zoratti
 

What's hot (20)

Introduction in Apache Maven2
Introduction in Apache Maven2Introduction in Apache Maven2
Introduction in Apache Maven2
 
Lorraine JUG (1st June, 2010) - Maven
Lorraine JUG (1st June, 2010) - MavenLorraine JUG (1st June, 2010) - Maven
Lorraine JUG (1st June, 2010) - Maven
 
Tools Coverage for the Java EE Platform @ Silicon Valley Code Camp 2010
Tools Coverage for the Java EE Platform @ Silicon Valley Code Camp 2010Tools Coverage for the Java EE Platform @ Silicon Valley Code Camp 2010
Tools Coverage for the Java EE Platform @ Silicon Valley Code Camp 2010
 
Getting Started with Rails on GlassFish (Hands-on Lab) - Spark IT 2010
Getting Started with Rails on GlassFish (Hands-on Lab) - Spark IT 2010Getting Started with Rails on GlassFish (Hands-on Lab) - Spark IT 2010
Getting Started with Rails on GlassFish (Hands-on Lab) - Spark IT 2010
 
Liferay maven sdk
Liferay maven sdkLiferay maven sdk
Liferay maven sdk
 
Deep Dive Hands-on in Java EE 6 - Oredev 2010
Deep Dive Hands-on in Java EE 6 - Oredev 2010Deep Dive Hands-on in Java EE 6 - Oredev 2010
Deep Dive Hands-on in Java EE 6 - Oredev 2010
 
Drupal 8. What's cooking (based on Angela Byron slides)
Drupal 8. What's cooking (based on Angela Byron slides)Drupal 8. What's cooking (based on Angela Byron slides)
Drupal 8. What's cooking (based on Angela Byron slides)
 
Maven for eXo VN
Maven for eXo VNMaven for eXo VN
Maven for eXo VN
 
Magnolia CMS 5.0 - UI Architecture
Magnolia CMS 5.0 - UI ArchitectureMagnolia CMS 5.0 - UI Architecture
Magnolia CMS 5.0 - UI Architecture
 
Glass Fishv3 March2010
Glass Fishv3 March2010Glass Fishv3 March2010
Glass Fishv3 March2010
 
Apache Maven - eXo TN presentation
Apache Maven - eXo TN presentationApache Maven - eXo TN presentation
Apache Maven - eXo TN presentation
 
GWT Overview And Feature Preview - SV Web JUG - June 16 2009
GWT Overview And Feature Preview - SV Web JUG -  June 16 2009GWT Overview And Feature Preview - SV Web JUG -  June 16 2009
GWT Overview And Feature Preview - SV Web JUG - June 16 2009
 
Tuscany : Applying OSGi After The Fact
Tuscany : Applying  OSGi After The FactTuscany : Applying  OSGi After The Fact
Tuscany : Applying OSGi After The Fact
 
Maven, Eclipse and OSGi Working Together - Carlos Sanchez
Maven, Eclipse and OSGi Working Together - Carlos SanchezMaven, Eclipse and OSGi Working Together - Carlos Sanchez
Maven, Eclipse and OSGi Working Together - Carlos Sanchez
 
Powering the Next Generation Services with Java Platform - Spark IT 2010
Powering the Next Generation Services with Java Platform - Spark IT 2010Powering the Next Generation Services with Java Platform - Spark IT 2010
Powering the Next Generation Services with Java Platform - Spark IT 2010
 
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3 Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
 
Java 7 Modularity: a View from the Gallery
Java 7 Modularity: a View from the GalleryJava 7 Modularity: a View from the Gallery
Java 7 Modularity: a View from the Gallery
 
Magnolia CMS 5.0 - Overview
Magnolia CMS 5.0 - OverviewMagnolia CMS 5.0 - Overview
Magnolia CMS 5.0 - Overview
 
Java EE 6 and GlassFish v3: Paving the path for future
Java EE 6 and GlassFish v3: Paving the path for futureJava EE 6 and GlassFish v3: Paving the path for future
Java EE 6 and GlassFish v3: Paving the path for future
 
The Dolphins Leap Again
The Dolphins Leap AgainThe Dolphins Leap Again
The Dolphins Leap Again
 

Viewers also liked

How to develop your creativity
How to develop your creativityHow to develop your creativity
How to develop your creativity
Return on Intelligence
 
Windows Azure: Quick start
Windows Azure: Quick startWindows Azure: Quick start
Windows Azure: Quick start
Return on Intelligence
 
Successful interview for a young IT specialist
Successful interview for a young IT specialistSuccessful interview for a young IT specialist
Successful interview for a young IT specialist
Return on Intelligence
 
Agile Project Grows
Agile Project GrowsAgile Project Grows
Agile Project Grows
Return on Intelligence
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
Return on Intelligence
 
English for E-mails
English for E-mailsEnglish for E-mails
English for E-mails
Return on Intelligence
 
Quality Principles
Quality PrinciplesQuality Principles
Quality Principles
Return on Intelligence
 
Non Blocking Algorithms at Traffic Conditions
Non Blocking Algorithms at Traffic ConditionsNon Blocking Algorithms at Traffic Conditions
Non Blocking Algorithms at Traffic Conditions
Return on Intelligence
 
Time Management
Time ManagementTime Management
Time Management
Return on Intelligence
 
Apache Maven presentation from BitByte conference
Apache Maven presentation from BitByte conferenceApache Maven presentation from BitByte conference
Apache Maven presentation from BitByte conference
Return on Intelligence
 
Profsoux2014 presentation by Pavelchuk
Profsoux2014 presentation by PavelchukProfsoux2014 presentation by Pavelchuk
Profsoux2014 presentation by PavelchukReturn on Intelligence
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
Return on Intelligence
 
Large Scale Software Project
Large Scale Software ProjectLarge Scale Software Project
Large Scale Software Project
Return on Intelligence
 
Jira as a test management tool
Jira as a test management toolJira as a test management tool
Jira as a test management tool
Return on Intelligence
 
Service design principles and patterns
Service design principles and patternsService design principles and patterns
Service design principles and patterns
Return on Intelligence
 
Risk Management
Risk ManagementRisk Management
Risk Management
Return on Intelligence
 
Principles of personal effectiveness
Principles of personal effectivenessPrinciples of personal effectiveness
Principles of personal effectiveness
Return on Intelligence
 
Cross-cultural communication
Cross-cultural communicationCross-cultural communication
Cross-cultural communication
Return on Intelligence
 
Gradle
GradleGradle
Resolving conflicts
Resolving conflictsResolving conflicts
Resolving conflicts
Return on Intelligence
 

Viewers also liked (20)

How to develop your creativity
How to develop your creativityHow to develop your creativity
How to develop your creativity
 
Windows Azure: Quick start
Windows Azure: Quick startWindows Azure: Quick start
Windows Azure: Quick start
 
Successful interview for a young IT specialist
Successful interview for a young IT specialistSuccessful interview for a young IT specialist
Successful interview for a young IT specialist
 
Agile Project Grows
Agile Project GrowsAgile Project Grows
Agile Project Grows
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
English for E-mails
English for E-mailsEnglish for E-mails
English for E-mails
 
Quality Principles
Quality PrinciplesQuality Principles
Quality Principles
 
Non Blocking Algorithms at Traffic Conditions
Non Blocking Algorithms at Traffic ConditionsNon Blocking Algorithms at Traffic Conditions
Non Blocking Algorithms at Traffic Conditions
 
Time Management
Time ManagementTime Management
Time Management
 
Apache Maven presentation from BitByte conference
Apache Maven presentation from BitByte conferenceApache Maven presentation from BitByte conference
Apache Maven presentation from BitByte conference
 
Profsoux2014 presentation by Pavelchuk
Profsoux2014 presentation by PavelchukProfsoux2014 presentation by Pavelchuk
Profsoux2014 presentation by Pavelchuk
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Large Scale Software Project
Large Scale Software ProjectLarge Scale Software Project
Large Scale Software Project
 
Jira as a test management tool
Jira as a test management toolJira as a test management tool
Jira as a test management tool
 
Service design principles and patterns
Service design principles and patternsService design principles and patterns
Service design principles and patterns
 
Risk Management
Risk ManagementRisk Management
Risk Management
 
Principles of personal effectiveness
Principles of personal effectivenessPrinciples of personal effectiveness
Principles of personal effectiveness
 
Cross-cultural communication
Cross-cultural communicationCross-cultural communication
Cross-cultural communication
 
Gradle
GradleGradle
Gradle
 
Resolving conflicts
Resolving conflictsResolving conflicts
Resolving conflicts
 

Similar to Apache Maven 2 Part 2

Apache maven 2. advanced topics
Apache maven 2. advanced topicsApache maven 2. advanced topics
Apache maven 2. advanced topics
Return on Intelligence
 
Continuous Deployment Pipeline with maven
Continuous Deployment Pipeline with mavenContinuous Deployment Pipeline with maven
Continuous Deployment Pipeline with mavenAlan Parkinson
 
How maven makes your development group look like a bunch of professionals.
How maven makes your development group look like a bunch of professionals.How maven makes your development group look like a bunch of professionals.
How maven makes your development group look like a bunch of professionals.Fazreil Amreen Abdul Jalil
 
Maven introduction in Mule
Maven introduction in MuleMaven introduction in Mule
Maven introduction in Mule
Shahid Shaik
 
Maven
MavenMaven
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
GenevaJUG
 
Hands On with Maven
Hands On with MavenHands On with Maven
Hands On with Maven
Sid Anand
 
Oracle 12c Launch Event 02 ADF 12c and Maven in Jdeveloper / By Aino Andriessen
Oracle 12c Launch Event 02 ADF 12c and Maven in Jdeveloper / By Aino Andriessen Oracle 12c Launch Event 02 ADF 12c and Maven in Jdeveloper / By Aino Andriessen
Oracle 12c Launch Event 02 ADF 12c and Maven in Jdeveloper / By Aino Andriessen
Getting value from IoT, Integration and Data Analytics
 
Maven 3 Overview
Maven 3  OverviewMaven 3  Overview
Maven 3 Overview
Mike Ensor
 
Riviera JUG (20th April, 2010) - Maven
Riviera JUG (20th April, 2010) - MavenRiviera JUG (20th April, 2010) - Maven
Riviera JUG (20th April, 2010) - Maven
Arnaud Héritier
 
Maven in Mule
Maven in MuleMaven in Mule
Maven in Mule
Anand kalla
 
Lausanne Jug (08th April, 2010) - Maven
Lausanne Jug (08th April, 2010) - MavenLausanne Jug (08th April, 2010) - Maven
Lausanne Jug (08th April, 2010) - Maven
Arnaud Héritier
 
Developing Liferay Plugins with Maven
Developing Liferay Plugins with MavenDeveloping Liferay Plugins with Maven
Developing Liferay Plugins with Maven
Mika Koivisto
 
S/W Design and Modularity using Maven
S/W Design and Modularity using MavenS/W Design and Modularity using Maven
S/W Design and Modularity using Maven
Scheidt & Bachmann
 
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
SISTechnologies
 
Apache Maven basics
Apache Maven basicsApache Maven basics
Apache Maven basics
Volodymyr Ostapiv
 
Training in Android with Maven
Training in Android with MavenTraining in Android with Maven
Training in Android with Maven
Arcadian Learning
 

Similar to Apache Maven 2 Part 2 (20)

Apache maven 2. advanced topics
Apache maven 2. advanced topicsApache maven 2. advanced topics
Apache maven 2. advanced topics
 
Apache maven 2 overview
Apache maven 2 overviewApache maven 2 overview
Apache maven 2 overview
 
Continuous Deployment Pipeline with maven
Continuous Deployment Pipeline with mavenContinuous Deployment Pipeline with maven
Continuous Deployment Pipeline with maven
 
How maven makes your development group look like a bunch of professionals.
How maven makes your development group look like a bunch of professionals.How maven makes your development group look like a bunch of professionals.
How maven makes your development group look like a bunch of professionals.
 
Maven introduction in Mule
Maven introduction in MuleMaven introduction in Mule
Maven introduction in Mule
 
Maven
MavenMaven
Maven
 
Maven
MavenMaven
Maven
 
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
 
Hands On with Maven
Hands On with MavenHands On with Maven
Hands On with Maven
 
Oracle 12c Launch Event 02 ADF 12c and Maven in Jdeveloper / By Aino Andriessen
Oracle 12c Launch Event 02 ADF 12c and Maven in Jdeveloper / By Aino Andriessen Oracle 12c Launch Event 02 ADF 12c and Maven in Jdeveloper / By Aino Andriessen
Oracle 12c Launch Event 02 ADF 12c and Maven in Jdeveloper / By Aino Andriessen
 
Maven 3 Overview
Maven 3  OverviewMaven 3  Overview
Maven 3 Overview
 
Riviera JUG (20th April, 2010) - Maven
Riviera JUG (20th April, 2010) - MavenRiviera JUG (20th April, 2010) - Maven
Riviera JUG (20th April, 2010) - Maven
 
Maven in Mule
Maven in MuleMaven in Mule
Maven in Mule
 
Lausanne Jug (08th April, 2010) - Maven
Lausanne Jug (08th April, 2010) - MavenLausanne Jug (08th April, 2010) - Maven
Lausanne Jug (08th April, 2010) - Maven
 
intellimeet
intellimeetintellimeet
intellimeet
 
Developing Liferay Plugins with Maven
Developing Liferay Plugins with MavenDeveloping Liferay Plugins with Maven
Developing Liferay Plugins with Maven
 
S/W Design and Modularity using Maven
S/W Design and Modularity using MavenS/W Design and Modularity using Maven
S/W Design and Modularity using Maven
 
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
 
Apache Maven basics
Apache Maven basicsApache Maven basics
Apache Maven basics
 
Training in Android with Maven
Training in Android with MavenTraining in Android with Maven
Training in Android with Maven
 

More from Return on Intelligence

Types of testing and their classification
Types of testing and their classificationTypes of testing and their classification
Types of testing and their classificationReturn on Intelligence
 
Differences between Testing in Waterfall and Agile
Differences between Testing in Waterfall and AgileDifferences between Testing in Waterfall and Agile
Differences between Testing in Waterfall and Agile
Return on Intelligence
 
Организация внутренней системы обучения
Организация внутренней системы обученияОрганизация внутренней системы обучения
Организация внутренней системы обученияReturn on Intelligence
 
Shared position in a project: testing and analysis
Shared position in a project: testing and analysisShared position in a project: testing and analysis
Shared position in a project: testing and analysis
Return on Intelligence
 
Introduction to Business Etiquette
Introduction to Business EtiquetteIntroduction to Business Etiquette
Introduction to Business Etiquette
Return on Intelligence
 
Agile Testing Process
Agile Testing ProcessAgile Testing Process
Agile Testing Process
Return on Intelligence
 
Оценка задач выполняемых по итеративной разработке
Оценка задач выполняемых по итеративной разработкеОценка задач выполняемых по итеративной разработке
Оценка задач выполняемых по итеративной разработке
Return on Intelligence
 
Meetings arranging
Meetings arrangingMeetings arranging
Meetings arranging
Return on Intelligence
 
The art of project estimation
The art of project estimationThe art of project estimation
The art of project estimation
Return on Intelligence
 
Velocity как инструмент планирования и управления проектом
Velocity как инструмент планирования и управления проектомVelocity как инструмент планирования и управления проектом
Velocity как инструмент планирования и управления проектом
Return on Intelligence
 
Testing your code
Testing your codeTesting your code
Testing your code
Return on Intelligence
 

More from Return on Intelligence (13)

Types of testing and their classification
Types of testing and their classificationTypes of testing and their classification
Types of testing and their classification
 
Differences between Testing in Waterfall and Agile
Differences between Testing in Waterfall and AgileDifferences between Testing in Waterfall and Agile
Differences between Testing in Waterfall and Agile
 
Windows azurequickstart
Windows azurequickstartWindows azurequickstart
Windows azurequickstart
 
Организация внутренней системы обучения
Организация внутренней системы обученияОрганизация внутренней системы обучения
Организация внутренней системы обучения
 
Shared position in a project: testing and analysis
Shared position in a project: testing and analysisShared position in a project: testing and analysis
Shared position in a project: testing and analysis
 
Introduction to Business Etiquette
Introduction to Business EtiquetteIntroduction to Business Etiquette
Introduction to Business Etiquette
 
Agile Testing Process
Agile Testing ProcessAgile Testing Process
Agile Testing Process
 
Оценка задач выполняемых по итеративной разработке
Оценка задач выполняемых по итеративной разработкеОценка задач выполняемых по итеративной разработке
Оценка задач выполняемых по итеративной разработке
 
Meetings arranging
Meetings arrangingMeetings arranging
Meetings arranging
 
The art of project estimation
The art of project estimationThe art of project estimation
The art of project estimation
 
Velocity как инструмент планирования и управления проектом
Velocity как инструмент планирования и управления проектомVelocity как инструмент планирования и управления проектом
Velocity как инструмент планирования и управления проектом
 
Testing your code
Testing your codeTesting your code
Testing your code
 
Reports Project
Reports ProjectReports Project
Reports Project
 

Recently uploaded

Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Enhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZEnhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZ
Globus
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 

Recently uploaded (20)

Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Enhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZEnhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZ
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 

Apache Maven 2 Part 2

  • 1. Apache Maven 2 Overview Part 2 Advanced Topics of Apache Maven 2 Anatoly Kondratyev September 2012 30 January 2013 Exigen Services confidential Exigen Services confidential
  • 2. The Goal • Understand several Maven capabilities • Build multi-module project with Maven • Some special pom blocks • Nexus configuration notes Exigen Services confidential 2
  • 3. Maven in real world WORKING WITH MULTI-MODULE PROJECTS Exigen Services confidential 3
  • 4. Project contents GWT application EJB A EJB B My Library Exigen Services confidential 4
  • 5. What to do with Maven? • 4 independent artifacts with dependencies • Build in one step? • Organize versioning? • Keeping up to date? • Wrong! • Maven Inheritance and Aggregation • Solves the above problems • Right! Exigen Services confidential 5
  • 6. Maven Inheritance & Aggregation • <packaging>pom</packaging> • Super pom • Data in parent pom is inherited • Maven dependency reactor • Notes • No cyclic dependencies • No same modules Exigen Services confidential 6
  • 7. Maven Inheritance & Aggregation Parent pom EJB A EJB B Gwt My library ejb ejb war jar Exigen Services confidential 7
  • 8. Maven in action <project …> <modelVersion>4.0.0</modelVersion> <groupId>ru.exigenservices</groupId> <artifactId>my-parent</artifactId> <version>1.0.1-SNAPSHOT</version> <packaging>pom</packaging> <modules> <module>EJB-A</module> <module>EJB-B</module> <module>Gwt</module> <module>MyLibrary</module> </modules> </project> Exigen Services confidential 8
  • 9. Maven in action • What about deployment? • EAR needed • Special step needed • Maybe divide frontend and backend? • NB! One pom – one artifact Exigen Services confidential 9
  • 10. Maven in action Parent pom Frontend Backend pom pom Frontend Backend Gwt EJB A EJB B My library wrapper wrapper jar war ear ejb ejb ear Exigen Services confidential 10
  • 11. Multimodal hierarchy • Parent pom <project …> <groupId>exigen</groupId> <artifactId>parent</artifactId> <version>1.0.1-SNAPSHOT</version> <packaging>pom</packaging> <modules> <module>backend</module> <module>frontend</module> </modules> </project> • Frontend pom <project …> <parent> <groupId>exigen</groupId> <artifactId>parent</artifactId> <version>1.0.1-SNAPSHOT</version> </parent> <artifactId>frontend</artifactId> <packaging>pom</packaging> <modules> <module>Gwt</module> </modules> </project> Exigen Services confidential 11
  • 12. Dependency&Plugin management • Changeable, overriddable and inheritable • In parent • GroupId & ArtifactId • Version • Everything you can configure • Type, packaging • In child • GroupId & ArtifactId Exigen Services confidential 12
  • 13. Dependency&Plugin Management Parent: <dependencyManagement> <dependencies> <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>6.0</version> <scope>provided</scope> </dependency> </dependencies> </dependencyManagement> Child: <dependencies> <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> </dependency> </dependencies> Exigen Services confidential 13
  • 14. Flat vs Tree, Flat . |-- my-module | `-- pom.xml `--parent `--pom.xml • Pom.xml for my-module: <project> <parent> <groupId>com.mycompany.app</groupId> <artifactId>my-app</artifactId> <version>1</version> <relativePath>.../parent/pom.xml</relativePath> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>my-module</artifactId> </project> Exigen Services confidential 15
  • 15. Maven reactor • Collects all the available modules to build • Sorts the projects into the correct build order • a project dependency on another module in the build • different rules with plugins dependencies • the order declared in the <modules> element (if no other rule applies) • Builds the selected projects in order • Be aware of cycles and same modules on different parents Exigen Services confidential 16
  • 16. Conclusion • Inheritance and aggregation • Flat/Tree structure • Maven reactor • Dependency&Plugin management • Deploy to Nexus/Weblogic problem Exigen Services confidential 17
  • 17. What will help you PROPERTIES, PROFILES, EXECUTION BLOCKS Exigen Services confidential 18
  • 18. Maven properties • Just as common Ant properties • ${property_name} • Case sensitive • Upper case for environment variables • Dot(.) notated path Exigen Services confidential 19
  • 19. Predefined properties • Build in properties • ${basedir} – directory with pom • ${version} – artifact version • Project properties • ${project.build.directory} • ${project.build.outputDirectory} (target/classes) • ${project.name} • ${project.version} • Local user settings • ${settings.localRepository} • Environment properties • ${env.M2_HOME} Exigen Services confidential 20
  • 20. Maven profiles • Maven profile – special way for configuring build • Different environments – different results • Renaming • Different build cycles • Special plugin configuration • Just different targets • For different users Exigen Services confidential 22
  • 21. Maven profiles • Per project • pom.xml • Per user • %USER_HOME%/.m2/settings.xml • Per computer (Global) • %M2_HOME%/conf/settings.xml Exigen Services confidential 23
  • 22. Maven profiles • Activation • By hand (-P profile1,profile2) • <activeProfiles> • <activation> • By environment settings • By properties Exigen Services confidential 24
  • 23. Maven profiles <profiles> <profile> <activation> <jdk>[1.3,1.6)</jdk> </activation> ... </profile> <profile> <activation> <property> <name>environment</name> <value>test</value> </property> </activation> ... </profile> </profiles> Exigen Services confidential 25
  • 24. Mojo • Plugin • Executing action • Mojo – magical charm in hoodoo • Just a Goal • Plugin consists of Mojos • Some parameters • MOJO aka POJO (Plain-old-Java-object) Exigen Services confidential 27
  • 25. Mojo • When we should use mojos? • Run from command line • Different execution parameters for different configurations • Group of mojos from same plugin with different configuration Exigen Services confidential 28
  • 26. Execution blocks Plugin:time <plugin> <groupId>com.mycompany.example</groupId> <artifactId>plugin</artifactId> <version>1.0</version> <executions> <execution> <id>first</id> <phase>test</phase> <goals> <goal>time</goal> </goals> <configuration> … </configuration> </execution> <execution> <id>default</id> … <!– No phase block --> </execution> </executions> </plugin> Exigen Services confidential 29
  • 27. SCM SourceCodeManagement • CVS, Mercurial, Perforce, Subversion, etc. • Commit/update • scm:bootstrap – build project • Maven Release Plugin • Snapshot  Version • Check everything • Commit Exigen Services confidential 30
  • 28. Maven archetypes • Create folders, poms, general stuff • Archetype  Project • For creating project: • archetype:generate • Select archetype from list • Set up groupId, artifactId, version, … • Get all project structure and draft files • maven-archetype-quickstart • For creating archetype: • archetype:create-from-project Exigen Services confidential 31
  • 29. Provided Arhetypes • maven-archetype-archetype • Sample archetype • maven-archetype-j2ee-simple • Simplified sample J2EE application • maven-archetype-plugin • Sample Maven plugin • maven-archetype-quickstart • Sample Maven project • maven-archetype-webapp • Sample Maven Webapp project • More information: http://maven.apache.org/archetype/maven-archetype-bundles/ Exigen Services confidential 32
  • 30. archetype:create-from-project • Sample project • mvn archetype:create-from-project • src catalog • Pom.xml (maven-archetype) • Some resources • Modify code (…targetgenerated-sourcesarchetype) • archetype-metadata.xml • Update properties and default values; review • Go to target, run “mvn install” • To test archetype “mvn archetype:generate -DarchetypeCatalog=local” Exigen Services confidential 33
  • 31. Good configuration - great advantage NEXUS SETTING.XML Exigen Services confidential 34
  • 32. Sonatype Nexus • Artifact repository • Nexus and Nexus Pro • Rather simple • Widely used • Other Maven Repository Managers • Apache Archiva • Artifactory • Comparison http://docs.codehaus.org/display/MAVENUSER/Maven+Repository+Manager+Fe ature+Matrix Exigen Services confidential 35
  • 33. Nexus hints • Nexus configuration + local configuration • Proxy repositories • Add everything and cache it! • Add to Public Repositories group • Restrictions on uploading artifacts • UI: Artifact Upload Exigen Services confidential 36
  • 34. Settings.xml • Servers • Profile <servers> <profiles> <server> <profile> <id>nexus</id> <id>nexus</id> <username>…</username> <repositories> <password>…</password> <repository> </server> <id>central</id> </servers> <url>http://central</url> • Mirrors (2.0.9) <releases> <mirrors> <enabled>true</enabled> <mirror> <updatePolicy>never</updatePolicy> <id>nexus</id> </releases> <mirrorOf>*</mirrorOf> <snapshots> <url>http://localserver:8081/nexus/content/groups/public/ <enabled>true</enabled> </url> </snapshots> </mirror> </repository> </mirrors> </repositories> • Active Profile <pluginRepositories> <activeProfiles> … </pluginRepositories> <activeProfile>nexus</activeProfile> </profile> </activeProfiles> </profiles> Exigen Services confidential 37
  • 35. updatePolicy • UpdatePolicy • Always • Daily (default) • Interval:X (X – integer in minutes) • Never • Repository Snapshots • Enabled true/false Exigen Services confidential 38
  • 36. When you have free time… LICENSE, ORGANIZATION, DEVELOPER S, CONTRIBUTORS Exigen Services confidential 39
  • 37. Licenses • How your project could be used? <licenses> <license> <name>The Apache Software License, Version 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> <distribution>repo</distribution> <comments>A business-friendly OSS license</comments> </license> </licenses> Exigen Services confidential 40
  • 38. Organization • Just tell everybody! <organization> <name>Exigen Services</name> <url>http://www.exigenservices.ru/</url> </organization> Exigen Services confidential 41
  • 39. Developers & Contributors block • Id, name, email • Organization, organizationUrl • Roles • Timezone • Properties • Contributors don’t have Id Exigen Services confidential 42
  • 40. Developers block <developers> <developer> <id>anatoly.k</id> <name>Anatoly</name> <email>Anatoly.Kondratiev@exigenservices.com</email> <organization>Exigen</organization> <organizationUrl>http://www.exigenservices.ru/</organizationUrl> <roles> <role>Configuration Manager</role> <role>Developer</role> </roles> <timezone>+3</timezone> <properties> <skype>anatoly.kondratyev</skype> </properties> </developer> </developers> Exigen Services confidential
  • 41. Final notes • A great amount of plugins • Ant-run • Mirrors on local repo, not on computer Exigen Services confidential 44
  • 42. Now it’s your turn… QUESTIONS Exigen Services confidential 45