SlideShare a Scribd company logo
Hands On With
Maven
Sid Anand (LinkedIn)
July 19, 2012
Overview


Maven is a build system providing
  A standard directory structure
  A standard build lifecycle
  The ability to override default behaviors via plug-ins
  Dependency management
The Maven Directory Structure
The Maven Directory Structure
•   A standard directory structure means that the build tool and the user agree on
    where different types of files can be found.

•   These conventions make coming up to speed on new projects much easier

       •   Java Source Tree goes under /src/main/java

       •   Property files goes under /src/main/resources

       •   Web App files go under /src/main/webapp

           •   /src/main/webapp/WEB-INF

           •   /src/main/webapp/WEB-INF/web.xml

           •   /src/main/webapp/*.jsp

           •   /src/main/webapp/*.html
The Maven Directory Structure
                    Path                   Description

/src/main/java             root of source tree (e.g. com/linkedin/...)


/src/main/resources        Place configuration & property files here


/src/main/scripts          Place scripts here


/src/main/webapp           Place web resources here (e.g. .jsp, .html)

                           root of test source tree (e.g. com/
/src/test/java
                           linkedin/test/...)

                           Place configuration & property files
/src/test/resources
                           needed for tests

                           Generated during build. Contains all build
/target/
                           output
The Default Maven Life Cycle
The Default Maven Life Cycle
•   A default Maven Life Cycle means that you do not need to manually specify build-
    steps and chain them together in each project:

       •   target = “package” dependsOn = “unit-test”

       •   target = “unit-test” dependsOn = “compile”

       •   target = “compile” dependsOn = “validate”

•   If you have worked with other build-tools (e.g. Make, Scala Build Tool, Ant, etc...),
    you will find that you are copying build-specs and specifying this boiler-plate logic
    often

•   Maven specifies a set of standard build steps and also automatically chains them
    together

•   This is part of the Maven framework and is not the responsibility of the user to
    define
The Default Maven Life Cycle
                Build Phase                                      Description

Validate                                        Validate things like the pom.xml files

                                                Compile sources after resolving and
Compile
                                                downloading dependencies

Test                                            Run Unit Tests

Package                                         Create JAR or WAR

Integration-test                                Run integration tests against the package

Verify                                          Does the package meet quality criteria?

Install                                         Install in local repository


• Calling “mvn <build phase>” will call all steps before it in order
  • e.g. calling “mvn install” will call validate, then compile, then test, then .....
Understanding the POM.xml
Understanding the POM.xml




The pom.xml file is Maven’s build spec file (e.g.
              build.xml in Ant)
Understanding the POM.xml
     <project>
  <modelVersion>4.0.0</modelVersion>

  <!-- The Basics -->
  <groupId>...</groupId>
  <artifactId>...</artifactId>
  <version>...</version>
  <packaging>...</packaging>
  <dependencies>...</dependencies>
  <parent>...</parent>
  <dependencyManagement>...</dependencyManagement>
  <modules>...</modules>
  <properties>...</properties>

  <!-- Build Settings -->
  <build>...</build>
  <reporting>...</reporting>

  <!-- More Project Information -->
  <name>...</name>
  <description>...</description>
  <url>...</url>
  <inceptionYear>...</inceptionYear>
  <licenses>...</licenses>
  <organization>...</organization>
  <developers>...</developers>
  <contributors>...</contributors>

  <!-- Environment Settings -->
  <issueManagement>...</issueManagement>
  <ciManagement>...</ciManagement>
  <mailingLists>...</mailingLists>
  <scm>...</scm>
  <prerequisites>...</prerequisites>
  <repositories>...</repositories>
  <pluginRepositories>...</pluginRepositories>
  <distributionManagement>...</distributionManagement>
  <profiles>...</profiles>
</project>
Understanding the POM.xml
<project>
  <modelVersion>4.0.0</modelVersion>

  <!-- The Basics -->
  <groupId>...</groupId>
  <artifactId>...</artifactId>
  <version>...</version>
  <packaging>...</packaging>
  <dependencies>...</dependencies>
  <parent>...</parent>
  <dependencyManagement>...</dependencyManagement>
  <modules>...</modules>
  <properties>...</properties>

  <!-- Build Settings -->


                                          The elements you will likely use
  <build>...</build>
  <reporting>...</reporting>

  <!-- More Project Information -->
  <name>...</name>
  <description>...</description>
  <url>...</url>
  <inceptionYear>...</inceptionYear>
  <licenses>...</licenses>
  <organization>...</organization>
  <developers>...</developers>
  <contributors>...</contributors>

  <!-- Environment Settings -->
  <issueManagement>...</issueManagement>
  <ciManagement>...</ciManagement>
  <mailingLists>...</mailingLists>
  <scm>...</scm>
  <prerequisites>...</prerequisites>
  <repositories>...</repositories>
  <pluginRepositories>...</pluginRepositories>
  <distributionManagement>...</distributionManagement>
  <profiles>...</profiles>
</project>
The Basics (POM)
Understanding the POM.xml
The <groupId, artifactId, version> tuple forms a
                                                         <project>
unique address for a project (and its artifact)
                                                           <modelVersion>4.0.0</modelVersion>
   •It is aptly known as a Maven coordinate
                                                           <!-- The Basics -->
packaging defaults to jar. Other options include pom       <groupId>...</groupId>
and war                                                    <artifactId>...</artifactId>
                                                           <version>...</version>
dependencies refers to a set of dependency                 <packaging>...</packaging>
elements, each of which define a jar that this projects     <dependencies>...</dependencies>
depends on.                                                <parent>...</parent>
                                                           <modules>...</modules>
                                                           <properties>...</properties>
For example, if this project required Log4J, you would
specify a dependency element containing a Maven          ......
coordinate as shown below:                               </project>

<dependencies>
    <dependency>
             <groupId>log4j</groupId>
             <artifactId>log4j</artifactId>
             <version>1.2.17</version>
        </dependency>
</dependencies>
Understanding the POM.xml
To figure out the co-ordinates for a jar when faced with a   <project>
ClassNoDefFound exception:                                    <modelVersion>4.0.0</modelVersion>

<dependencies>                                                <!-- The Basics -->
    <dependency>                                              <groupId>...</groupId>
             <groupId>log4j</groupId>                         <artifactId>...</artifactId>
             <artifactId>log4j</artifactId>                   <version>...</version>
             <version>1.2.17</version>                        <packaging>...</packaging>
        </dependency>                                         <dependencies>...</dependencies>
</dependencies>                                               <parent>...</parent>
                                                              <modules>...</modules>
                                                              <properties>...</properties>
1. Try searching on Jarvana ( http://jarvana.com/
                                                            ......
jarvana/ ). This will give you the names of jars
                                                            </project>
containing the Class in question

2. If you know the JAR name, search on Maven Central
for all versions of the JAR. Pick the version you like.

Both Maven Central and Jarvana provide Maven
coordinates.
Understanding the POM.xml
The parent and modules elements are needed for
                                                              <project>
parent-child projects.
                                                                <modelVersion>4.0.0</modelVersion>

                                                                <!-- The Basics -->
To illustrate, imagine a typical search-indexing project        <groupId>...</groupId>
called Foo.                                                     <artifactId>...</artifactId>
                                                                <version>...</version>
In our Foo project, imagine that we have 3 build artifacts:     <packaging>...</packaging>
                                                                <dependencies>...</dependencies>
1. An indexer.jar for Indexing code                             <parent>...</parent>
                                                                <modules>...</modules>
2. A search.war for Lucene-based servlet code                   <properties>...</properties>

3. A ui.war for UI-specific code                               ......
                                                              </project>

One way to structure the code is to create 3 Maven modules
(ui, indexer, and search) under a common parent (Foo)
Understanding the POM.xml
                                    Hence, we will have a directory structure as shown below:
                                    a Foo directory containing 3 sub-directories and 1 parent pom.xml:

                                          •
                                              a search sub-directory
                                                •
                                                 this follows the standard Maven Directory structure
                                                •
                                                 it contains a pom.xml for the search module

                                          •
                                              an indexer sub-directory
                                                •
                                                  this follows the standard Maven Directory structure
                                                •
                                                  it contains a pom.xml for the indexer module

                                          •
                                              a ui subdirectory
                                                •
                                                 this follows the standard Maven Directory structure
                                                •
                                                 it contains a pom.xml for the ui module
          Foo
                                          •
                                              a parent pom.xml file
                     search
search
                  pom.xml
                                indexer
indexer
                              pom.xml
                                                           ui
  ui
                                                    pom.xml

pom.xml
Understanding the POM.xml
                                                        <project>
<project>
                                                          <modelVersion>4.0.0</modelVersion>
  <modelVersion>4.0.0</modelVersion>
                                                          <!-- The Basics -->
  <!-- The Basics -->                                     <groupId>com.linkedin</groupId>
                                                          <artifactId>Foo-search</artifactId>
  <groupId>com.linkedin</groupId>                         <version>1.0</version>
  <artifactId>Foo</artifactId>                            <packaging>war</packaging>
  <version>1.0</version>                                  <parent>Foo</parent>
  <packaging>pom</packaging>                            ......
  <modules>                                             </project>
     <module>ui</module>                                <project>
     <module>search</module>                              <modelVersion>4.0.0</modelVersion>
     <module>indexer</module>                             <!-- The Basics -->
  </modules>                                              <groupId>com.linkedin</groupId>
......                                                    <artifactId>Foo-indexer</artifactId>
                                                          <version>1.0</version>
</project>
                                                          <packaging>jar</packaging>
                                                          <parent>Foo</parent>

                                                        ......
                                                        </project>
                   search                               <project>
 search                                                   <modelVersion>4.0.0</modelVersion>
                pom.xml
                                    indexer               <!-- The Basics -->
                                                          <groupId>com.linkedin</groupId>
 indexer                                                  <artifactId>Foo-ui</artifactId>
                              pom.xml
                                                   ui     <version>1.0</version>
                                                          <packaging>war</packaging>
   ui                                                     <parent>Foo</parent>
                                              pom.xml
                                                        ......
                                                        </project>
pom.xml
Understanding the POM.xml
                                                             <project>
<project>
                                                               <modelVersion>4.0.0</modelVersion>
  <modelVersion>4.0.0</modelVersion>
                                                               <!-- The Basics -->
  <!-- The Basics -->                                          <groupId>com.linkedin</groupId>
                                                               <artifactId>Foo-search</artifactId>
  <groupId>com.linkedin</groupId>                              <version>1.0</version>
  <artifactId>Foo</artifactId>                                 <packaging>war</packaging>
  <version>1.0</version>                                       <parent>Foo</parent>
  <packaging>pom</packaging>                                 ......
  <modules>                                                  </project>
     <module>ui</module>                                     <project>
     <module>search</module>                                   <modelVersion>4.0.0</modelVersion>
     <module>indexer</module>                 <Parent> Tag     <!-- The Basics -->
  </modules>                                     in child      <groupId>com.linkedin</groupId>
......                                          pom.xml        <artifactId>Foo-indexer</artifactId>
                                                               <version>1.0</version>
</project>
                                                               <packaging>jar</packaging>
                                                               <parent>Foo</parent>

                                                             ......
                   search                                    </project>
                                                             <project>
 search                                                        <modelVersion>4.0.0</modelVersion>
                pom.xml
                                    indexer                    <!-- The Basics -->
                                                               <groupId>com.linkedin</groupId>
 indexer                                                       <artifactId>Foo-ui</artifactId>
                              pom.xml
                                                     ui        <version>1.0</version>
                                                               <packaging>war</packaging>
   ui                                                          <parent>Foo</parent>
                                               pom.xml
                                                             ......
                                                             </project>
pom.xml
Understanding the POM.xml
                                                        <project>
<project>                                                 <modelVersion>4.0.0</modelVersion>
  <modelVersion>4.0.0</modelVersion>
                                                          <!-- The Basics -->
                                                          <groupId>com.linkedin</groupId>
  <!-- The Basics -->                                     <artifactId>Foo-search</artifactId>
  <groupId>com.linkedin</groupId>                         <version>1.0</version>
  <artifactId>Foo</artifactId>                            <packaging>war</packaging>
                                                          <parent>Foo</parent>
  <version>1.0</version>            pom
  <packaging>pom</packaging>    <packaging>             ......
  <modules>                         type                </project>
     <module>ui</module>                                <project>
                                                          <modelVersion>4.0.0</modelVersion>
     <module>search</module>
     <module>indexer</module> 3 <Module> <Parent> Tag     <!-- The Basics -->
  </modules>                    Tags in the  in child     <groupId>com.linkedin</groupId>
......                            parent    pom.xml       <artifactId>Foo-indexer</artifactId>
                                                          <version>1.0</version>
</project>                       pom.xml                  <packaging>jar</packaging>
                                                          <parent>Foo</parent>

                                                        ......
                                                        </project>
                   search                               <project>
 search                                                   <modelVersion>4.0.0</modelVersion>
                pom.xml
                                 indexer                  <!-- The Basics -->
                                                          <groupId>com.linkedin</groupId>
indexer                                                   <artifactId>Foo-ui</artifactId>
                              pom.xml
                                                 ui       <version>1.0</version>
                                                          <packaging>war</packaging>
   ui                                                     <parent>Foo</parent>
                                           pom.xml
                                                        ......
                                                        </project>
pom.xml
Understanding the POM.xml
 Some Useful Information

 -- The child POMs inherit the settings in the parent POM.

 -- Calling “mvn <command>” on the parent causes all child POMs to be executed

 -- Calling “mvn <command>” on a child POM executes on that single child POM, but does
 correctly inherit settings from parent POM




          Foo
                        search
search
                     pom.xml
                                       indexer
indexer
                                    pom.xml
                                                        ui
  ui
                                                   pom.xml

pom.xml
More Project Information (POM)
Understanding the POM.xml

                                       <!-- More Project Information -->
                                       <name>...</name>
                                       <description>...</description>
                                       <url>...</url>
These fields are pretty self-           <inceptionYear>...</inceptionYear>
explanatory. Good to include,          <licenses>...</licenses>
                                       <organization>...</organization>
especially for open-source projects.   <developers>...</developers>
                                       <contributors>...</contributors>
Environment Settings (POM)
Understanding the POM.xml
The repositories tag refers to refers to repositories that Maven
should refer to when looking for the jars listed in the dependencies
section that we already covered.                                            <!-- Environment Settings -->
                                                                              <issueManagement>...</issueManagement>
If you do not specify a repositories tag, Maven will look in the default      <ciManagement>...</ciManagement>
repository : http://search.maven.org/#browse (a.k.a. http://                  <mailingLists>...</mailingLists>
repo.maven.apache.org/maven2/ )                                               <scm>...</scm>
                                                                              <prerequisites>...</prerequisites>
If you need to access jars from a private repository (e.g. LinkedIn’s         <repositories>...</repositories>
Artifactory) and from the default public repository:                          <pluginRepositories>...</
                                                                            pluginRepositories>
repositories>                                                                 <distributionManagement>...</
  <repository>                                                              distributionManagement>
    <id>public-central</id>                                                   <profiles>...</profiles>
    <url> http://repo.maven.apache.org/maven2/ </url>                       </project>
    <snapshots>
       <enabled>false</enabled>
    </snapshots>
  </repository>
  <repository>
    <id>central-private</id>
    <url>
          http://artifactory.corp.linkedin.com......./artifactory/release
     </url>
    <snapshots>
       <enabled>false</enabled>
    </snapshots>
  </repository>
Understanding the POM.xml
The SCM tag refers to Source Control Management. Maven offers
pretty advanced plug-ins for Git and SVN.
                                                                   <!-- Environment Settings -->
An example Git SCM tag is shown below. With this enabled, you
                                                                     <issueManagement>...</issueManagement>
can use powerful features in Maven such as release. “mvn
                                                                     <ciManagement>...</ciManagement>
release:perform” can release a WAR or JAR to Artifactory or to a
                                                                     <mailingLists>...</mailingLists>
public Maven repo.
                                                                     <scm>...</scm>
                                                                     <prerequisites>...</prerequisites>
Once complete, Maven will automatically up-rev the pom.xml
                                                                     <repositories>...</repositories>
version and commit/push the new pom.xml to the Git “origin”
                                                                     <pluginRepositories>...</
server using the Git connect strings in the SCM tag.
                                                                   pluginRepositories>
                                                                     <distributionManagement>...</
                                                                   distributionManagement>
<scm>
                                                                     <profiles>...</profiles>
    <connection>                                                   </project>
      scm:git:git@gitli.corp.linkedin.com:ds-platform/listt.git
    </connection>
    <url>
      scm:git:git@gitli.corp.linkedin.com:ds-platform/listt.git
    </url>
    <developerConnection>
      scm:git:git@gitli.corp.linkedin.com:ds-platform/listt.git
    </developerConnection>
</scm>
Understanding the POM.xml
The distributionManagement tag is the reverse of the
repositories tag -- it refers to the repository where the build      <!-- Environment Settings -->
artifact (i.e. JAR or WAR) will be stored.                             <issueManagement>...</issueManagement>
                                                                       <ciManagement>...</ciManagement>
                                                                       <mailingLists>...</mailingLists>
From the previous “mvn release:perform” example, the information       <scm>...</scm>
in the distributionManagement tag tells Maven where to post the        <prerequisites>...</prerequisites>
jar.                                                                   <repositories>...</repositories>
                                                                       <pluginRepositories>...</
<distributionManagement >                                            pluginRepositories>
  <repository>                                                         <distributionManagement>...</
     <id>central-private</id>                                        distributionManagement>
     <url>                                                             <profiles>...</profiles>
          http://artifactory.corp.linkedin.com......./artifactory/   </project>
          release
     </url>
     <snapshots>
        <enabled>false</enabled>
     </snapshots>
  </repository>
</distributionManagement >
Some Useful Commands
Some Useful Commands
All commands must be run in the same directory containing the pom.xml.

• mvn clean, compile --> cleans the project, then compiles it
• mvn clean package --> previous step + create WAR or JAR
• mvn clean install --> previous step + run integration tests and install the WAR or JAR in the
local repository

• mvn release:prepare --> Does the following:
  • prompts the user for the version of the jar
  • alters the version in the POM.xml (i.e. 1.0-SNAPSHOT --> 1.0)
  • runs a clean-compile-test-package cycle
  • and generates a release.properties file
• mvn release:perform --> Does the following:
  • pushes the JAR/WAR to Artifactory or some public repo
  • If successful, bumps up the version in the pom.xml file (i.e. 1.0 --> 1.1-SNAPSHOT)
     • You should never need to alter the version in the POM.xml file!

More Related Content

What's hot

PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBoot
Josué Neis
 
Spring Boot
Spring BootSpring Boot
Spring Boot
HongSeong Jeon
 
Spring framework in depth
Spring framework in depthSpring framework in depth
Spring framework in depth
Vinay Kumar
 
Jenkins
JenkinsJenkins
Cross platform mobile development
Cross platform mobile developmentCross platform mobile development
Cross platform mobile development
Peter Friese
 
Spring boot
Spring bootSpring boot
Spring boot
Pradeep Shanmugam
 
Maven
MavenMaven
Maven
MavenMaven
Maven
Emprovise
 
Angular components
Angular componentsAngular components
Angular components
Sultan Ahmed
 
Spring Boot
Spring BootSpring Boot
Spring Boot
Jiayun Zhou
 
Junit
JunitJunit
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
Peng Xiao
 
An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to MavenVadym Lotar
 
BDD with Cucumber
BDD with CucumberBDD with Cucumber
BDD with Cucumber
Knoldus Inc.
 
Reactjs
ReactjsReactjs
Testing Spring Boot Applications
Testing Spring Boot ApplicationsTesting Spring Boot Applications
Testing Spring Boot Applications
VMware Tanzu
 
Selenium
SeleniumSelenium
Styled components presentation
Styled components presentationStyled components presentation
Styled components presentation
Maciej Matuszewski
 
Spring boot jpa
Spring boot jpaSpring boot jpa
Spring boot jpa
Hamid Ghorbani
 

What's hot (20)

PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBoot
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Spring framework in depth
Spring framework in depthSpring framework in depth
Spring framework in depth
 
Jenkins
JenkinsJenkins
Jenkins
 
Maven Overview
Maven OverviewMaven Overview
Maven Overview
 
Cross platform mobile development
Cross platform mobile developmentCross platform mobile development
Cross platform mobile development
 
Spring boot
Spring bootSpring boot
Spring boot
 
Maven
MavenMaven
Maven
 
Maven
MavenMaven
Maven
 
Angular components
Angular componentsAngular components
Angular components
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Junit
JunitJunit
Junit
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to Maven
 
BDD with Cucumber
BDD with CucumberBDD with Cucumber
BDD with Cucumber
 
Reactjs
ReactjsReactjs
Reactjs
 
Testing Spring Boot Applications
Testing Spring Boot ApplicationsTesting Spring Boot Applications
Testing Spring Boot Applications
 
Selenium
SeleniumSelenium
Selenium
 
Styled components presentation
Styled components presentationStyled components presentation
Styled components presentation
 
Spring boot jpa
Spring boot jpaSpring boot jpa
Spring boot jpa
 

Viewers also liked

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
 
Hibernate 3
Hibernate 3Hibernate 3
Hibernate 3
Rajiv Gupta
 
Maven
Maven Maven
Maven
Khan625
 
Hibernate
HibernateHibernate
Hibernate
Prashant Kalkar
 
An introduction to Maven
An introduction to MavenAn introduction to Maven
An introduction to Maven
Joao Pereira
 
Maven and ANT
Maven and ANTMaven and ANT
Maven and ANT
Sun Technlogies
 
Demystifying Maven
Demystifying MavenDemystifying Maven
Demystifying Maven
Mike Desjardins
 
Intro To Hibernate
Intro To HibernateIntro To Hibernate
Intro To Hibernate
Amit Himani
 
Spring Framework - MVC
Spring Framework - MVCSpring Framework - MVC
Spring Framework - MVC
Dzmitry Naskou
 
Spring Framework - Core
Spring Framework - CoreSpring Framework - Core
Spring Framework - Core
Dzmitry Naskou
 
Java 9 and the impact on Maven Projects (JavaOne 2016)
Java 9 and the impact on Maven Projects (JavaOne 2016)Java 9 and the impact on Maven Projects (JavaOne 2016)
Java 9 and the impact on Maven Projects (JavaOne 2016)
Robert Scholte
 

Viewers also liked (11)

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
 
Hibernate 3
Hibernate 3Hibernate 3
Hibernate 3
 
Maven
Maven Maven
Maven
 
Hibernate
HibernateHibernate
Hibernate
 
An introduction to Maven
An introduction to MavenAn introduction to Maven
An introduction to Maven
 
Maven and ANT
Maven and ANTMaven and ANT
Maven and ANT
 
Demystifying Maven
Demystifying MavenDemystifying Maven
Demystifying Maven
 
Intro To Hibernate
Intro To HibernateIntro To Hibernate
Intro To Hibernate
 
Spring Framework - MVC
Spring Framework - MVCSpring Framework - MVC
Spring Framework - MVC
 
Spring Framework - Core
Spring Framework - CoreSpring Framework - Core
Spring Framework - Core
 
Java 9 and the impact on Maven Projects (JavaOne 2016)
Java 9 and the impact on Maven Projects (JavaOne 2016)Java 9 and the impact on Maven Projects (JavaOne 2016)
Java 9 and the impact on Maven Projects (JavaOne 2016)
 

Similar to Hands On with Maven

Maven in Mule
Maven in MuleMaven in Mule
Maven in Mule
Anand kalla
 
Maven
MavenMaven
Maven
javeed_mhd
 
Maven
MavenMaven
Apache Maven
Apache MavenApache Maven
Apache Maven
venkatraghavang
 
Maven introduction in Mule
Maven introduction in MuleMaven introduction in Mule
Maven introduction in Mule
Shahid Shaik
 
Maven
MavenMaven
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
 
Maven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafeMaven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafeHolasz Kati
 
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
Dmitry Bakaleinik
 
An Introduction to Maven and Flex
An Introduction to Maven and FlexAn Introduction to Maven and Flex
An Introduction to Maven and Flex
Justin J. Moses
 
Note - Apache Maven Intro
Note - Apache Maven IntroNote - Apache Maven Intro
Note - Apache Maven Introboyw165
 
Java, Eclipse, Maven & JSF tutorial
Java, Eclipse, Maven & JSF tutorialJava, Eclipse, Maven & JSF tutorial
Java, Eclipse, Maven & JSF tutorial
Raghavan Mohan
 
Introduction to maven
Introduction to mavenIntroduction to maven
Introduction to maven
Manos Georgopoulos
 
BMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenBMO - Intelligent Projects with Maven
BMO - Intelligent Projects with Maven
Mert Çalışkan
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
Mert Çalışkan
 
Releasing Projects Using Maven
Releasing Projects Using MavenReleasing Projects Using Maven
Releasing Projects Using Maven
Maria Odea Ching-Mallete
 

Similar to Hands On with Maven (20)

Maven in Mule
Maven in MuleMaven in Mule
Maven in Mule
 
Maven
MavenMaven
Maven
 
Maven
MavenMaven
Maven
 
Apache Maven
Apache MavenApache Maven
Apache Maven
 
intellimeet
intellimeetintellimeet
intellimeet
 
Maven
MavenMaven
Maven
 
Mavenppt
MavenpptMavenppt
Mavenppt
 
Maven introduction in Mule
Maven introduction in MuleMaven introduction in Mule
Maven introduction in Mule
 
Maven
MavenMaven
Maven
 
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
 
Maven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafeMaven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafe
 
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
 
An Introduction to Maven and Flex
An Introduction to Maven and FlexAn Introduction to Maven and Flex
An Introduction to Maven and Flex
 
Note - Apache Maven Intro
Note - Apache Maven IntroNote - Apache Maven Intro
Note - Apache Maven Intro
 
Java, Eclipse, Maven & JSF tutorial
Java, Eclipse, Maven & JSF tutorialJava, Eclipse, Maven & JSF tutorial
Java, Eclipse, Maven & JSF tutorial
 
Introduction to maven
Introduction to mavenIntroduction to maven
Introduction to maven
 
BMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenBMO - Intelligent Projects with Maven
BMO - Intelligent Projects with Maven
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
 
Releasing Projects Using Maven
Releasing Projects Using MavenReleasing Projects Using Maven
Releasing Projects Using Maven
 

More from Sid Anand

Building High Fidelity Data Streams (QCon London 2023)
Building High Fidelity Data Streams (QCon London 2023)Building High Fidelity Data Streams (QCon London 2023)
Building High Fidelity Data Streams (QCon London 2023)
Sid Anand
 
Building & Operating High-Fidelity Data Streams - QCon Plus 2021
Building & Operating High-Fidelity Data Streams - QCon Plus 2021Building & Operating High-Fidelity Data Streams - QCon Plus 2021
Building & Operating High-Fidelity Data Streams - QCon Plus 2021
Sid Anand
 
Low Latency Fraud Detection & Prevention
Low Latency Fraud Detection & PreventionLow Latency Fraud Detection & Prevention
Low Latency Fraud Detection & Prevention
Sid Anand
 
YOW! Data Keynote (2021)
YOW! Data Keynote (2021)YOW! Data Keynote (2021)
YOW! Data Keynote (2021)
Sid Anand
 
Big Data, Fast Data @ PayPal (YOW 2018)
Big Data, Fast Data @ PayPal (YOW 2018)Big Data, Fast Data @ PayPal (YOW 2018)
Big Data, Fast Data @ PayPal (YOW 2018)
Sid Anand
 
Building Better Data Pipelines using Apache Airflow
Building Better Data Pipelines using Apache AirflowBuilding Better Data Pipelines using Apache Airflow
Building Better Data Pipelines using Apache Airflow
Sid Anand
 
Cloud Native Predictive Data Pipelines (micro talk)
Cloud Native Predictive Data Pipelines (micro talk)Cloud Native Predictive Data Pipelines (micro talk)
Cloud Native Predictive Data Pipelines (micro talk)
Sid Anand
 
Cloud Native Data Pipelines (GoTo Chicago 2017)
Cloud Native Data Pipelines (GoTo Chicago 2017)Cloud Native Data Pipelines (GoTo Chicago 2017)
Cloud Native Data Pipelines (GoTo Chicago 2017)
Sid Anand
 
Cloud Native Data Pipelines (DataEngConf SF 2017)
Cloud Native Data Pipelines (DataEngConf SF 2017)Cloud Native Data Pipelines (DataEngConf SF 2017)
Cloud Native Data Pipelines (DataEngConf SF 2017)
Sid Anand
 
Cloud Native Data Pipelines (in Eng & Japanese) - QCon Tokyo
Cloud Native Data Pipelines (in Eng & Japanese)  - QCon TokyoCloud Native Data Pipelines (in Eng & Japanese)  - QCon Tokyo
Cloud Native Data Pipelines (in Eng & Japanese) - QCon Tokyo
Sid Anand
 
Cloud Native Data Pipelines (QCon Shanghai & Tokyo 2016)
Cloud Native Data Pipelines (QCon Shanghai & Tokyo 2016)Cloud Native Data Pipelines (QCon Shanghai & Tokyo 2016)
Cloud Native Data Pipelines (QCon Shanghai & Tokyo 2016)
Sid Anand
 
Introduction to Apache Airflow - Data Day Seattle 2016
Introduction to Apache Airflow - Data Day Seattle 2016Introduction to Apache Airflow - Data Day Seattle 2016
Introduction to Apache Airflow - Data Day Seattle 2016
Sid Anand
 
Airflow @ Agari
Airflow @ Agari Airflow @ Agari
Airflow @ Agari
Sid Anand
 
Resilient Predictive Data Pipelines (GOTO Chicago 2016)
Resilient Predictive Data Pipelines (GOTO Chicago 2016)Resilient Predictive Data Pipelines (GOTO Chicago 2016)
Resilient Predictive Data Pipelines (GOTO Chicago 2016)
Sid Anand
 
Resilient Predictive Data Pipelines (QCon London 2016)
Resilient Predictive Data Pipelines (QCon London 2016)Resilient Predictive Data Pipelines (QCon London 2016)
Resilient Predictive Data Pipelines (QCon London 2016)
Sid Anand
 
Software Developer and Architecture @ LinkedIn (QCon SF 2014)
Software Developer and Architecture @ LinkedIn (QCon SF 2014)Software Developer and Architecture @ LinkedIn (QCon SF 2014)
Software Developer and Architecture @ LinkedIn (QCon SF 2014)
Sid Anand
 
LinkedIn's Segmentation & Targeting Platform (Hadoop Summit 2013)
LinkedIn's Segmentation & Targeting Platform (Hadoop Summit 2013)LinkedIn's Segmentation & Targeting Platform (Hadoop Summit 2013)
LinkedIn's Segmentation & Targeting Platform (Hadoop Summit 2013)
Sid Anand
 
Building a Modern Website for Scale (QCon NY 2013)
Building a Modern Website for Scale (QCon NY 2013)Building a Modern Website for Scale (QCon NY 2013)
Building a Modern Website for Scale (QCon NY 2013)
Sid Anand
 
Learning git
Learning gitLearning git
Learning git
Sid Anand
 
LinkedIn Data Infrastructure Slides (Version 2)
LinkedIn Data Infrastructure Slides (Version 2)LinkedIn Data Infrastructure Slides (Version 2)
LinkedIn Data Infrastructure Slides (Version 2)
Sid Anand
 

More from Sid Anand (20)

Building High Fidelity Data Streams (QCon London 2023)
Building High Fidelity Data Streams (QCon London 2023)Building High Fidelity Data Streams (QCon London 2023)
Building High Fidelity Data Streams (QCon London 2023)
 
Building & Operating High-Fidelity Data Streams - QCon Plus 2021
Building & Operating High-Fidelity Data Streams - QCon Plus 2021Building & Operating High-Fidelity Data Streams - QCon Plus 2021
Building & Operating High-Fidelity Data Streams - QCon Plus 2021
 
Low Latency Fraud Detection & Prevention
Low Latency Fraud Detection & PreventionLow Latency Fraud Detection & Prevention
Low Latency Fraud Detection & Prevention
 
YOW! Data Keynote (2021)
YOW! Data Keynote (2021)YOW! Data Keynote (2021)
YOW! Data Keynote (2021)
 
Big Data, Fast Data @ PayPal (YOW 2018)
Big Data, Fast Data @ PayPal (YOW 2018)Big Data, Fast Data @ PayPal (YOW 2018)
Big Data, Fast Data @ PayPal (YOW 2018)
 
Building Better Data Pipelines using Apache Airflow
Building Better Data Pipelines using Apache AirflowBuilding Better Data Pipelines using Apache Airflow
Building Better Data Pipelines using Apache Airflow
 
Cloud Native Predictive Data Pipelines (micro talk)
Cloud Native Predictive Data Pipelines (micro talk)Cloud Native Predictive Data Pipelines (micro talk)
Cloud Native Predictive Data Pipelines (micro talk)
 
Cloud Native Data Pipelines (GoTo Chicago 2017)
Cloud Native Data Pipelines (GoTo Chicago 2017)Cloud Native Data Pipelines (GoTo Chicago 2017)
Cloud Native Data Pipelines (GoTo Chicago 2017)
 
Cloud Native Data Pipelines (DataEngConf SF 2017)
Cloud Native Data Pipelines (DataEngConf SF 2017)Cloud Native Data Pipelines (DataEngConf SF 2017)
Cloud Native Data Pipelines (DataEngConf SF 2017)
 
Cloud Native Data Pipelines (in Eng & Japanese) - QCon Tokyo
Cloud Native Data Pipelines (in Eng & Japanese)  - QCon TokyoCloud Native Data Pipelines (in Eng & Japanese)  - QCon Tokyo
Cloud Native Data Pipelines (in Eng & Japanese) - QCon Tokyo
 
Cloud Native Data Pipelines (QCon Shanghai & Tokyo 2016)
Cloud Native Data Pipelines (QCon Shanghai & Tokyo 2016)Cloud Native Data Pipelines (QCon Shanghai & Tokyo 2016)
Cloud Native Data Pipelines (QCon Shanghai & Tokyo 2016)
 
Introduction to Apache Airflow - Data Day Seattle 2016
Introduction to Apache Airflow - Data Day Seattle 2016Introduction to Apache Airflow - Data Day Seattle 2016
Introduction to Apache Airflow - Data Day Seattle 2016
 
Airflow @ Agari
Airflow @ Agari Airflow @ Agari
Airflow @ Agari
 
Resilient Predictive Data Pipelines (GOTO Chicago 2016)
Resilient Predictive Data Pipelines (GOTO Chicago 2016)Resilient Predictive Data Pipelines (GOTO Chicago 2016)
Resilient Predictive Data Pipelines (GOTO Chicago 2016)
 
Resilient Predictive Data Pipelines (QCon London 2016)
Resilient Predictive Data Pipelines (QCon London 2016)Resilient Predictive Data Pipelines (QCon London 2016)
Resilient Predictive Data Pipelines (QCon London 2016)
 
Software Developer and Architecture @ LinkedIn (QCon SF 2014)
Software Developer and Architecture @ LinkedIn (QCon SF 2014)Software Developer and Architecture @ LinkedIn (QCon SF 2014)
Software Developer and Architecture @ LinkedIn (QCon SF 2014)
 
LinkedIn's Segmentation & Targeting Platform (Hadoop Summit 2013)
LinkedIn's Segmentation & Targeting Platform (Hadoop Summit 2013)LinkedIn's Segmentation & Targeting Platform (Hadoop Summit 2013)
LinkedIn's Segmentation & Targeting Platform (Hadoop Summit 2013)
 
Building a Modern Website for Scale (QCon NY 2013)
Building a Modern Website for Scale (QCon NY 2013)Building a Modern Website for Scale (QCon NY 2013)
Building a Modern Website for Scale (QCon NY 2013)
 
Learning git
Learning gitLearning git
Learning git
 
LinkedIn Data Infrastructure Slides (Version 2)
LinkedIn Data Infrastructure Slides (Version 2)LinkedIn Data Infrastructure Slides (Version 2)
LinkedIn Data Infrastructure Slides (Version 2)
 

Recently uploaded

Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
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
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
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
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
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
 
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
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 

Recently uploaded (20)

Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
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...
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
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
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
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
 
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
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 

Hands On with Maven

  • 1. Hands On With Maven Sid Anand (LinkedIn) July 19, 2012
  • 2. Overview Maven is a build system providing A standard directory structure A standard build lifecycle The ability to override default behaviors via plug-ins Dependency management
  • 4. The Maven Directory Structure • A standard directory structure means that the build tool and the user agree on where different types of files can be found. • These conventions make coming up to speed on new projects much easier • Java Source Tree goes under /src/main/java • Property files goes under /src/main/resources • Web App files go under /src/main/webapp • /src/main/webapp/WEB-INF • /src/main/webapp/WEB-INF/web.xml • /src/main/webapp/*.jsp • /src/main/webapp/*.html
  • 5. The Maven Directory Structure Path Description /src/main/java root of source tree (e.g. com/linkedin/...) /src/main/resources Place configuration & property files here /src/main/scripts Place scripts here /src/main/webapp Place web resources here (e.g. .jsp, .html) root of test source tree (e.g. com/ /src/test/java linkedin/test/...) Place configuration & property files /src/test/resources needed for tests Generated during build. Contains all build /target/ output
  • 6. The Default Maven Life Cycle
  • 7. The Default Maven Life Cycle • A default Maven Life Cycle means that you do not need to manually specify build- steps and chain them together in each project: • target = “package” dependsOn = “unit-test” • target = “unit-test” dependsOn = “compile” • target = “compile” dependsOn = “validate” • If you have worked with other build-tools (e.g. Make, Scala Build Tool, Ant, etc...), you will find that you are copying build-specs and specifying this boiler-plate logic often • Maven specifies a set of standard build steps and also automatically chains them together • This is part of the Maven framework and is not the responsibility of the user to define
  • 8. The Default Maven Life Cycle Build Phase Description Validate Validate things like the pom.xml files Compile sources after resolving and Compile downloading dependencies Test Run Unit Tests Package Create JAR or WAR Integration-test Run integration tests against the package Verify Does the package meet quality criteria? Install Install in local repository • Calling “mvn <build phase>” will call all steps before it in order • e.g. calling “mvn install” will call validate, then compile, then test, then .....
  • 10. Understanding the POM.xml The pom.xml file is Maven’s build spec file (e.g. build.xml in Ant)
  • 11. Understanding the POM.xml <project> <modelVersion>4.0.0</modelVersion> <!-- The Basics --> <groupId>...</groupId> <artifactId>...</artifactId> <version>...</version> <packaging>...</packaging> <dependencies>...</dependencies> <parent>...</parent> <dependencyManagement>...</dependencyManagement> <modules>...</modules> <properties>...</properties> <!-- Build Settings --> <build>...</build> <reporting>...</reporting> <!-- More Project Information --> <name>...</name> <description>...</description> <url>...</url> <inceptionYear>...</inceptionYear> <licenses>...</licenses> <organization>...</organization> <developers>...</developers> <contributors>...</contributors> <!-- Environment Settings --> <issueManagement>...</issueManagement> <ciManagement>...</ciManagement> <mailingLists>...</mailingLists> <scm>...</scm> <prerequisites>...</prerequisites> <repositories>...</repositories> <pluginRepositories>...</pluginRepositories> <distributionManagement>...</distributionManagement> <profiles>...</profiles> </project>
  • 12. Understanding the POM.xml <project> <modelVersion>4.0.0</modelVersion> <!-- The Basics --> <groupId>...</groupId> <artifactId>...</artifactId> <version>...</version> <packaging>...</packaging> <dependencies>...</dependencies> <parent>...</parent> <dependencyManagement>...</dependencyManagement> <modules>...</modules> <properties>...</properties> <!-- Build Settings --> The elements you will likely use <build>...</build> <reporting>...</reporting> <!-- More Project Information --> <name>...</name> <description>...</description> <url>...</url> <inceptionYear>...</inceptionYear> <licenses>...</licenses> <organization>...</organization> <developers>...</developers> <contributors>...</contributors> <!-- Environment Settings --> <issueManagement>...</issueManagement> <ciManagement>...</ciManagement> <mailingLists>...</mailingLists> <scm>...</scm> <prerequisites>...</prerequisites> <repositories>...</repositories> <pluginRepositories>...</pluginRepositories> <distributionManagement>...</distributionManagement> <profiles>...</profiles> </project>
  • 14. Understanding the POM.xml The <groupId, artifactId, version> tuple forms a <project> unique address for a project (and its artifact) <modelVersion>4.0.0</modelVersion> •It is aptly known as a Maven coordinate <!-- The Basics --> packaging defaults to jar. Other options include pom <groupId>...</groupId> and war <artifactId>...</artifactId> <version>...</version> dependencies refers to a set of dependency <packaging>...</packaging> elements, each of which define a jar that this projects <dependencies>...</dependencies> depends on. <parent>...</parent> <modules>...</modules> <properties>...</properties> For example, if this project required Log4J, you would specify a dependency element containing a Maven ...... coordinate as shown below: </project> <dependencies> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version> </dependency> </dependencies>
  • 15. Understanding the POM.xml To figure out the co-ordinates for a jar when faced with a <project> ClassNoDefFound exception: <modelVersion>4.0.0</modelVersion> <dependencies> <!-- The Basics --> <dependency> <groupId>...</groupId> <groupId>log4j</groupId> <artifactId>...</artifactId> <artifactId>log4j</artifactId> <version>...</version> <version>1.2.17</version> <packaging>...</packaging> </dependency> <dependencies>...</dependencies> </dependencies> <parent>...</parent> <modules>...</modules> <properties>...</properties> 1. Try searching on Jarvana ( http://jarvana.com/ ...... jarvana/ ). This will give you the names of jars </project> containing the Class in question 2. If you know the JAR name, search on Maven Central for all versions of the JAR. Pick the version you like. Both Maven Central and Jarvana provide Maven coordinates.
  • 16. Understanding the POM.xml The parent and modules elements are needed for <project> parent-child projects. <modelVersion>4.0.0</modelVersion> <!-- The Basics --> To illustrate, imagine a typical search-indexing project <groupId>...</groupId> called Foo. <artifactId>...</artifactId> <version>...</version> In our Foo project, imagine that we have 3 build artifacts: <packaging>...</packaging> <dependencies>...</dependencies> 1. An indexer.jar for Indexing code <parent>...</parent> <modules>...</modules> 2. A search.war for Lucene-based servlet code <properties>...</properties> 3. A ui.war for UI-specific code ...... </project> One way to structure the code is to create 3 Maven modules (ui, indexer, and search) under a common parent (Foo)
  • 17. Understanding the POM.xml Hence, we will have a directory structure as shown below: a Foo directory containing 3 sub-directories and 1 parent pom.xml: • a search sub-directory • this follows the standard Maven Directory structure • it contains a pom.xml for the search module • an indexer sub-directory • this follows the standard Maven Directory structure • it contains a pom.xml for the indexer module • a ui subdirectory • this follows the standard Maven Directory structure • it contains a pom.xml for the ui module Foo • a parent pom.xml file search search pom.xml indexer indexer pom.xml ui ui pom.xml pom.xml
  • 18. Understanding the POM.xml <project> <project> <modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion> <!-- The Basics --> <!-- The Basics --> <groupId>com.linkedin</groupId> <artifactId>Foo-search</artifactId> <groupId>com.linkedin</groupId> <version>1.0</version> <artifactId>Foo</artifactId> <packaging>war</packaging> <version>1.0</version> <parent>Foo</parent> <packaging>pom</packaging> ...... <modules> </project> <module>ui</module> <project> <module>search</module> <modelVersion>4.0.0</modelVersion> <module>indexer</module> <!-- The Basics --> </modules> <groupId>com.linkedin</groupId> ...... <artifactId>Foo-indexer</artifactId> <version>1.0</version> </project> <packaging>jar</packaging> <parent>Foo</parent> ...... </project> search <project> search <modelVersion>4.0.0</modelVersion> pom.xml indexer <!-- The Basics --> <groupId>com.linkedin</groupId> indexer <artifactId>Foo-ui</artifactId> pom.xml ui <version>1.0</version> <packaging>war</packaging> ui <parent>Foo</parent> pom.xml ...... </project> pom.xml
  • 19. Understanding the POM.xml <project> <project> <modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion> <!-- The Basics --> <!-- The Basics --> <groupId>com.linkedin</groupId> <artifactId>Foo-search</artifactId> <groupId>com.linkedin</groupId> <version>1.0</version> <artifactId>Foo</artifactId> <packaging>war</packaging> <version>1.0</version> <parent>Foo</parent> <packaging>pom</packaging> ...... <modules> </project> <module>ui</module> <project> <module>search</module> <modelVersion>4.0.0</modelVersion> <module>indexer</module> <Parent> Tag <!-- The Basics --> </modules> in child <groupId>com.linkedin</groupId> ...... pom.xml <artifactId>Foo-indexer</artifactId> <version>1.0</version> </project> <packaging>jar</packaging> <parent>Foo</parent> ...... search </project> <project> search <modelVersion>4.0.0</modelVersion> pom.xml indexer <!-- The Basics --> <groupId>com.linkedin</groupId> indexer <artifactId>Foo-ui</artifactId> pom.xml ui <version>1.0</version> <packaging>war</packaging> ui <parent>Foo</parent> pom.xml ...... </project> pom.xml
  • 20. Understanding the POM.xml <project> <project> <modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion> <!-- The Basics --> <groupId>com.linkedin</groupId> <!-- The Basics --> <artifactId>Foo-search</artifactId> <groupId>com.linkedin</groupId> <version>1.0</version> <artifactId>Foo</artifactId> <packaging>war</packaging> <parent>Foo</parent> <version>1.0</version> pom <packaging>pom</packaging> <packaging> ...... <modules> type </project> <module>ui</module> <project> <modelVersion>4.0.0</modelVersion> <module>search</module> <module>indexer</module> 3 <Module> <Parent> Tag <!-- The Basics --> </modules> Tags in the in child <groupId>com.linkedin</groupId> ...... parent pom.xml <artifactId>Foo-indexer</artifactId> <version>1.0</version> </project> pom.xml <packaging>jar</packaging> <parent>Foo</parent> ...... </project> search <project> search <modelVersion>4.0.0</modelVersion> pom.xml indexer <!-- The Basics --> <groupId>com.linkedin</groupId> indexer <artifactId>Foo-ui</artifactId> pom.xml ui <version>1.0</version> <packaging>war</packaging> ui <parent>Foo</parent> pom.xml ...... </project> pom.xml
  • 21. Understanding the POM.xml Some Useful Information -- The child POMs inherit the settings in the parent POM. -- Calling “mvn <command>” on the parent causes all child POMs to be executed -- Calling “mvn <command>” on a child POM executes on that single child POM, but does correctly inherit settings from parent POM Foo search search pom.xml indexer indexer pom.xml ui ui pom.xml pom.xml
  • 23. Understanding the POM.xml <!-- More Project Information --> <name>...</name> <description>...</description> <url>...</url> These fields are pretty self- <inceptionYear>...</inceptionYear> explanatory. Good to include, <licenses>...</licenses> <organization>...</organization> especially for open-source projects. <developers>...</developers> <contributors>...</contributors>
  • 25. Understanding the POM.xml The repositories tag refers to refers to repositories that Maven should refer to when looking for the jars listed in the dependencies section that we already covered. <!-- Environment Settings --> <issueManagement>...</issueManagement> If you do not specify a repositories tag, Maven will look in the default <ciManagement>...</ciManagement> repository : http://search.maven.org/#browse (a.k.a. http:// <mailingLists>...</mailingLists> repo.maven.apache.org/maven2/ ) <scm>...</scm> <prerequisites>...</prerequisites> If you need to access jars from a private repository (e.g. LinkedIn’s <repositories>...</repositories> Artifactory) and from the default public repository: <pluginRepositories>...</ pluginRepositories> repositories> <distributionManagement>...</ <repository> distributionManagement> <id>public-central</id> <profiles>...</profiles> <url> http://repo.maven.apache.org/maven2/ </url> </project> <snapshots> <enabled>false</enabled> </snapshots> </repository> <repository> <id>central-private</id> <url> http://artifactory.corp.linkedin.com......./artifactory/release </url> <snapshots> <enabled>false</enabled> </snapshots> </repository>
  • 26. Understanding the POM.xml The SCM tag refers to Source Control Management. Maven offers pretty advanced plug-ins for Git and SVN. <!-- Environment Settings --> An example Git SCM tag is shown below. With this enabled, you <issueManagement>...</issueManagement> can use powerful features in Maven such as release. “mvn <ciManagement>...</ciManagement> release:perform” can release a WAR or JAR to Artifactory or to a <mailingLists>...</mailingLists> public Maven repo. <scm>...</scm> <prerequisites>...</prerequisites> Once complete, Maven will automatically up-rev the pom.xml <repositories>...</repositories> version and commit/push the new pom.xml to the Git “origin” <pluginRepositories>...</ server using the Git connect strings in the SCM tag. pluginRepositories> <distributionManagement>...</ distributionManagement> <scm> <profiles>...</profiles> <connection> </project> scm:git:git@gitli.corp.linkedin.com:ds-platform/listt.git </connection> <url> scm:git:git@gitli.corp.linkedin.com:ds-platform/listt.git </url> <developerConnection> scm:git:git@gitli.corp.linkedin.com:ds-platform/listt.git </developerConnection> </scm>
  • 27. Understanding the POM.xml The distributionManagement tag is the reverse of the repositories tag -- it refers to the repository where the build <!-- Environment Settings --> artifact (i.e. JAR or WAR) will be stored. <issueManagement>...</issueManagement> <ciManagement>...</ciManagement> <mailingLists>...</mailingLists> From the previous “mvn release:perform” example, the information <scm>...</scm> in the distributionManagement tag tells Maven where to post the <prerequisites>...</prerequisites> jar. <repositories>...</repositories> <pluginRepositories>...</ <distributionManagement > pluginRepositories> <repository> <distributionManagement>...</ <id>central-private</id> distributionManagement> <url> <profiles>...</profiles> http://artifactory.corp.linkedin.com......./artifactory/ </project> release </url> <snapshots> <enabled>false</enabled> </snapshots> </repository> </distributionManagement >
  • 29. Some Useful Commands All commands must be run in the same directory containing the pom.xml. • mvn clean, compile --> cleans the project, then compiles it • mvn clean package --> previous step + create WAR or JAR • mvn clean install --> previous step + run integration tests and install the WAR or JAR in the local repository • mvn release:prepare --> Does the following: • prompts the user for the version of the jar • alters the version in the POM.xml (i.e. 1.0-SNAPSHOT --> 1.0) • runs a clean-compile-test-package cycle • and generates a release.properties file • mvn release:perform --> Does the following: • pushes the JAR/WAR to Artifactory or some public repo • If successful, bumps up the version in the pom.xml file (i.e. 1.0 --> 1.1-SNAPSHOT) • You should never need to alter the version in the POM.xml file!