SlideShare una empresa de Scribd logo
1 de 18
Planning and Managing Software Projects 2011-12



Maven

Emanuele Della Valle, Lecturer: Daniele Dell’Aglio
http://emanueledellavalle.org
What is Maven?
   Maven is a project management tool
         Build automation tool
         Deployment tool
         Documentation generator
         Report generator
         ...
   Even if the focus in on Java projects, other
    programming languages are supported (C#, Ruby,
    etc.)




Planning and Managing Software Projects – Emanuele Della Valle
Convention
   Maven exploits the «Convention over configuration»
    approach
         Assumption about the location of source code, test,
          resources
         Assumption about the location of the output
         Etc.
   In general the conventions can be customized by users
   Example: folder layout
                  src/main/java
                  src/main/resources
                  src/test/java
                  src/test/resources



(http://maven.apache.org/guides/introduction/introduction-to-the-standard-
directory-layout.html)
Planning and Managing Software Projects – Emanuele Della Valle
Project Object Model
    The key element is the Project Object Model (POM)
    It is a xml file (pom.xml) located in the root of the
     project folder
    It contains the description of the project and all the
     information required by Maven
    POM contains:
            Project coordinates
            Dependencies
            Plugins
            Repositories
    A POM can be easily generated through
                                      mvn archetype:generate


 Planning and Managing Software Projects – Emanuele Della Valle
Project coordinates
       It is the “passport” of the artifact
       The required information are:
             Model version: the version of the POM
             Group id: unique identificator of the group/organization
              that creates the artifact
             Artifact id: unique identificator of the artifact
             Version: the version of the artifact. If the artifact is a
              non-stable/under development component, -SNAPSHOT
              should be added after the version number
      Another important information is the packaging
             It influences the build lifecycles
             Core packaging: jar (default), pom, maven-plugin, ejb,
              war, ear, rar, par



    Planning and Managing Software Projects – Emanuele Della Valle
Project coordinates
<project>
   <modelVersion>4.0.0</modelVersion>
   <groupId>pmsp.maven</groupId>
   <artifactId>firstexample</artifactId>
   <version>0.1</version>
   <packaging>jar</packaging>
</project>




 Planning and Managing Software Projects – Emanuele Della Valle
Dependencies
   POM contains the description of the artifacts
    required by the project
   Each dependency contains
         The required artifact (identified by its coordinates)
         The scope: controls the inclusion in the application
          and the availability in the classpath
                compile (default): required for compilation, in the
                 classpath and packaged
                provided: required for compilation, in the classpath but not
                 packaged (e.g. servlet.jar)
                runtime: required for the execution but not for the
                 compilation (e.g. JDBC, SLF4J bridges)
                test: required only for testing, not packaged (e.g. JUnit)
                system: like provided but with an explicit folder location


Planning and Managing Software Projects – Emanuele Della Valle
Dependencies
   In general the dependency is transitive
         It depends on the scope!
          http://maven.apache.org/guides/introduction/introductio
          n-to-dependency-mechanism.html#Dependency_Scope
   If the project requires artifact A, and artifact A requires
    artifact B, then also artifact B will be included in the
    project
   Users can disable the transitivity through the exclusion
    command




Planning and Managing Software Projects – Emanuele Della Valle
Dependencies
…
<dependencies>
         <dependency>
              <groupId>junit</groupId>
              <artifactId>junit</artifactId>
              <version>4.10</version>
              <scope>test</scope>
         </dependency>
        …
    </dependencies>
…



Planning and Managing Software Projects – Emanuele Della Valle
Plugins and Goals
     The Maven core doesn't contain the logic to compile,
      test, package the software
     Those features are provided through plugins
       •    Examples: archetype, jar, compiler, surefire
     As dependencies, projects should declare what are the
      required plugins
...
<plugins>
   <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
         <version>2.10</version>
   </plugin>
</plugins>
...

Planning and Managing Software Projects – Emanuele Della Valle
Goals
    Each plugin offers a set of goals
          A goal is an executable task
                                           plugin
                                                                  goal 1

                                                                  goal 2

                                                                  goal 3


 A goal can be invoked in the following way:
                                               mvn plugin:goal
 Example:
                                     mvn archetype:generate



 Planning and Managing Software Projects – Emanuele Della Valle
Phases and lifecycles
    A phase is a step in the build lifecycle, which is an
     ordered sequence of phases. [Apache Maven manual]
    Lifecycles can be used to execute mutliple operations
           A lifecycle models a sequence of operations
    Each step of a lifecycle is a phase
    When a lifecycle is executed, plugin goals are bound to
     the phases
            The goal bindings depends by the packaging!
    Built-in lifecycle
            default
            clean
            site

(http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html)
 Planning and Managing Software Projects – Emanuele Della Valle
Lifecycles: default (simplified)
                                                                  validate


                                                                  compile


                                                                    test


                                                              package


                                                         integration-test


                                                                   verify


                                                                   install


                                                                  deploy

 Planning and Managing Software Projects – Emanuele Della Valle
Lifecycles: default (simplified) - packaging jar

            validate
            compile                                • compiler:compile

                  test                             • surefire:test

           package                                 • jar:jar

 integration-test
               verify
               install                             • install:install

             deploy                                • deploy:deploy
 Planning and Managing Software Projects – Emanuele Della Valle
Lifecycles: default (simplified) - packaging pom

            validate
            compile
                  test
           package                                 • site:attach-descriptor

 integration-test
               verify
               install                             • install:install

             deploy                                • deploy:deploy
 Planning and Managing Software Projects – Emanuele Della Valle
Repositories
    Repositories are the places where dependencies and
     plugins are located
           They are declared into the POM
    When Maven runs, it connects to the repositories in
     order to retrieve the dependencies and the plugins
    There is a special repository that is built by Maven on
     the local machine
            It is located in these locations:
              –    Unix: ~/.m2/repository
              –    Win: C:%USER%.m2
      •     Its purpose is twofold:
              –   It is a cache
              –   Artifacts can be installed there (install:install) and be
                  available for the other artifacts



 Planning and Managing Software Projects – Emanuele Della Valle
Repositories
<repositories>
    <repository>
        <id>central</id>
        <name>Maven Repository Switchboard</name>
        <layout>default</layout>
        <url>http://repo1.maven.org/maven2</url>
        <snapshots>
             <enabled>false</enabled>
        </snapshots>
    </repository>
    ...
</repositories>
<pluginRepositories>
    <pluginRepository>
        ...
    </pluginRepository>
</pluginRepositories>

 Planning and Managing Software Projects – Emanuele Della Valle
References
 Maven http://maven.apache.org/guides/
 Apache Maven 2 (Dzone RefCard)
  http://refcardz.dzone.com/refcardz/apache-maven-2
 Maven: the complete reference (Sonatype)
  http://www.sonatype.com/books/mvnref-
  book/reference/
 Maven – The definitive Guide (O’Reilly)
  http://www.amazon.com/Maven-Definitive-Guide-
  Sonatype-Company/dp/0596517335




Planning and Managing Software Projects – Emanuele Della Valle

Más contenido relacionado

La actualidad más candente

Maven Basics - Explained
Maven Basics - ExplainedMaven Basics - Explained
Maven Basics - ExplainedSmita Prasad
 
An Introduction to Maven Part 1
An Introduction to Maven Part 1An Introduction to Maven Part 1
An Introduction to Maven Part 1MD Sayem Ahmed
 
Java Builds with Maven and Ant
Java Builds with Maven and AntJava Builds with Maven and Ant
Java Builds with Maven and AntDavid Noble
 
Drupal & Continous Integration - SF State Study Case
Drupal & Continous Integration - SF State Study CaseDrupal & Continous Integration - SF State Study Case
Drupal & Continous Integration - SF State Study CaseEmanuele Quinto
 
Build Automation using Maven
Build Automation using Maven Build Automation using Maven
Build Automation using Maven Ankit Gubrani
 
Hands On with Maven
Hands On with MavenHands On with Maven
Hands On with MavenSid Anand
 
Maven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in MavenMaven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in MavenGeert Pante
 
Automated Deployment with Maven - going the whole nine yards
Automated Deployment with Maven - going the whole nine yardsAutomated Deployment with Maven - going the whole nine yards
Automated Deployment with Maven - going the whole nine yardsJohn Ferguson Smart Limited
 
Continuous Deployment Pipeline with maven
Continuous Deployment Pipeline with mavenContinuous Deployment Pipeline with maven
Continuous Deployment Pipeline with mavenAlan Parkinson
 
02 - Build and Deployment Management
02 - Build and Deployment Management02 - Build and Deployment Management
02 - Build and Deployment ManagementSergii Shmarkatiuk
 
Maven for Dummies
Maven for DummiesMaven for Dummies
Maven for DummiesTomer Gabel
 
Maven 3 Overview
Maven 3  OverviewMaven 3  Overview
Maven 3 OverviewMike Ensor
 
Continuous Delivery Overview
Continuous Delivery OverviewContinuous Delivery Overview
Continuous Delivery OverviewWill Iverson
 

La actualidad más candente (20)

Maven Basics - Explained
Maven Basics - ExplainedMaven Basics - Explained
Maven Basics - Explained
 
Apache Maven
Apache MavenApache Maven
Apache Maven
 
An Introduction to Maven Part 1
An Introduction to Maven Part 1An Introduction to Maven Part 1
An Introduction to Maven Part 1
 
Introduction to Maven
Introduction to MavenIntroduction to Maven
Introduction to Maven
 
Java Builds with Maven and Ant
Java Builds with Maven and AntJava Builds with Maven and Ant
Java Builds with Maven and Ant
 
Drupal & Continous Integration - SF State Study Case
Drupal & Continous Integration - SF State Study CaseDrupal & Continous Integration - SF State Study Case
Drupal & Continous Integration - SF State Study Case
 
Build Automation using Maven
Build Automation using Maven Build Automation using Maven
Build Automation using Maven
 
Continuous delivery-with-maven
Continuous delivery-with-mavenContinuous delivery-with-maven
Continuous delivery-with-maven
 
Maven basics
Maven basicsMaven basics
Maven basics
 
Maven Overview
Maven OverviewMaven Overview
Maven Overview
 
Hands On with Maven
Hands On with MavenHands On with Maven
Hands On with Maven
 
Maven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in MavenMaven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in Maven
 
Automated Deployment with Maven - going the whole nine yards
Automated Deployment with Maven - going the whole nine yardsAutomated Deployment with Maven - going the whole nine yards
Automated Deployment with Maven - going the whole nine yards
 
Maven
MavenMaven
Maven
 
Continuous Deployment Pipeline with maven
Continuous Deployment Pipeline with mavenContinuous Deployment Pipeline with maven
Continuous Deployment Pipeline with maven
 
02 - Build and Deployment Management
02 - Build and Deployment Management02 - Build and Deployment Management
02 - Build and Deployment Management
 
Maven ppt
Maven pptMaven ppt
Maven ppt
 
Maven for Dummies
Maven for DummiesMaven for Dummies
Maven for Dummies
 
Maven 3 Overview
Maven 3  OverviewMaven 3  Overview
Maven 3 Overview
 
Continuous Delivery Overview
Continuous Delivery OverviewContinuous Delivery Overview
Continuous Delivery Overview
 

Destacado

IMaRS - Incremental Materialization for RDF Streams (SR4LD2013)
IMaRS - Incremental Materialization for RDF Streams (SR4LD2013)IMaRS - Incremental Materialization for RDF Streams (SR4LD2013)
IMaRS - Incremental Materialization for RDF Streams (SR4LD2013)Daniele Dell'Aglio
 
Learning for a New Leadership:The Collaborative Redesign of Lidera Programme
Learning for a New Leadership:The Collaborative Redesign of Lidera ProgrammeLearning for a New Leadership:The Collaborative Redesign of Lidera Programme
Learning for a New Leadership:The Collaborative Redesign of Lidera ProgrammeObservatório do Recife
 
RDF Stream Processing Models (RSP2014)
RDF Stream Processing Models (RSP2014)RDF Stream Processing Models (RSP2014)
RDF Stream Processing Models (RSP2014)Daniele Dell'Aglio
 

Destacado (6)

Wapz
WapzWapz
Wapz
 
IMaRS - Incremental Materialization for RDF Streams (SR4LD2013)
IMaRS - Incremental Materialization for RDF Streams (SR4LD2013)IMaRS - Incremental Materialization for RDF Streams (SR4LD2013)
IMaRS - Incremental Materialization for RDF Streams (SR4LD2013)
 
Kapittel 15
Kapittel 15Kapittel 15
Kapittel 15
 
Learning for a New Leadership:The Collaborative Redesign of Lidera Programme
Learning for a New Leadership:The Collaborative Redesign of Lidera ProgrammeLearning for a New Leadership:The Collaborative Redesign of Lidera Programme
Learning for a New Leadership:The Collaborative Redesign of Lidera Programme
 
Kapittel 15
Kapittel 15Kapittel 15
Kapittel 15
 
RDF Stream Processing Models (RSP2014)
RDF Stream Processing Models (RSP2014)RDF Stream Processing Models (RSP2014)
RDF Stream Processing Models (RSP2014)
 

Similar a P&MSP2012 - Maven

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
 
Introduction to maven, its configuration, lifecycle and relationship to JS world
Introduction to maven, its configuration, lifecycle and relationship to JS worldIntroduction to maven, its configuration, lifecycle and relationship to JS world
Introduction to maven, its configuration, lifecycle and relationship to JS worldDmitry Bakaleinik
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topicGourav Varma
 
Learning Maven by Example
Learning Maven by ExampleLearning Maven by Example
Learning Maven by ExampleHsi-Kai Wang
 
Java, Eclipse, Maven & JSF tutorial
Java, Eclipse, Maven & JSF tutorialJava, Eclipse, Maven & JSF tutorial
Java, Eclipse, Maven & JSF tutorialRaghavan Mohan
 
Introduction to Maven for beginners and DevOps
Introduction to Maven for beginners and DevOpsIntroduction to Maven for beginners and DevOps
Introduction to Maven for beginners and DevOpsSISTechnologies
 
Maven in mulesoft
Maven in mulesoftMaven in mulesoft
Maven in mulesoftvenkata20k
 
Java build tools
Java build toolsJava build tools
Java build toolsSujit Kumar
 
(Re)-Introduction to Maven
(Re)-Introduction to Maven(Re)-Introduction to Maven
(Re)-Introduction to MavenEric Wyles
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulMert Çalışkan
 
Maven 2.0 - Project management and comprehension tool
Maven 2.0 - Project management and comprehension toolMaven 2.0 - Project management and comprehension tool
Maven 2.0 - Project management and comprehension toolelliando dias
 

Similar a P&MSP2012 - Maven (20)

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
 
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
 
Maven Introduction
Maven IntroductionMaven Introduction
Maven Introduction
 
Mavennotes.pdf
Mavennotes.pdfMavennotes.pdf
Mavennotes.pdf
 
Maven
MavenMaven
Maven
 
Maven
MavenMaven
Maven
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topic
 
Learning Maven by Example
Learning Maven by ExampleLearning Maven by Example
Learning Maven by Example
 
Maven
MavenMaven
Maven
 
Java, Eclipse, Maven & JSF tutorial
Java, Eclipse, Maven & JSF tutorialJava, Eclipse, Maven & JSF tutorial
Java, Eclipse, Maven & JSF tutorial
 
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
 
Maven in mulesoft
Maven in mulesoftMaven in mulesoft
Maven in mulesoft
 
Maven
MavenMaven
Maven
 
Maven
MavenMaven
Maven
 
Java build tools
Java build toolsJava build tools
Java build tools
 
(Re)-Introduction to Maven
(Re)-Introduction to Maven(Re)-Introduction to Maven
(Re)-Introduction to Maven
 
Maven
MavenMaven
Maven
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
 
Maven
MavenMaven
Maven
 
Maven 2.0 - Project management and comprehension tool
Maven 2.0 - Project management and comprehension toolMaven 2.0 - Project management and comprehension tool
Maven 2.0 - Project management and comprehension tool
 

Más de Daniele Dell'Aglio

Distributed stream consistency checking
Distributed stream consistency checkingDistributed stream consistency checking
Distributed stream consistency checkingDaniele Dell'Aglio
 
Triplewave: a step towards RDF Stream Processing on the Web
Triplewave: a step towards RDF Stream Processing on the WebTriplewave: a step towards RDF Stream Processing on the Web
Triplewave: a step towards RDF Stream Processing on the WebDaniele Dell'Aglio
 
On unifying query languages for RDF streams
On unifying query languages for RDF streamsOn unifying query languages for RDF streams
On unifying query languages for RDF streamsDaniele Dell'Aglio
 
RSEP-QL: A Query Model to Capture Event Pattern Matching in RDF Stream Proces...
RSEP-QL: A Query Model to Capture Event Pattern Matching in RDF Stream Proces...RSEP-QL: A Query Model to Capture Event Pattern Matching in RDF Stream Proces...
RSEP-QL: A Query Model to Capture Event Pattern Matching in RDF Stream Proces...Daniele Dell'Aglio
 
Summary of the Stream Reasoning workshop at ISWC 2016
Summary of the Stream Reasoning workshop at ISWC 2016Summary of the Stream Reasoning workshop at ISWC 2016
Summary of the Stream Reasoning workshop at ISWC 2016Daniele Dell'Aglio
 
On Unified Stream Reasoning - The RDF Stream Processing realm
On Unified Stream Reasoning - The RDF Stream Processing realmOn Unified Stream Reasoning - The RDF Stream Processing realm
On Unified Stream Reasoning - The RDF Stream Processing realmDaniele Dell'Aglio
 
Querying the Web of Data with XSPARQL 1.1
Querying the Web of Data with XSPARQL 1.1Querying the Web of Data with XSPARQL 1.1
Querying the Web of Data with XSPARQL 1.1Daniele Dell'Aglio
 
Augmented Participation to Live Events through Social Network Content Enrichm...
Augmented Participation to Live Events through Social Network Content Enrichm...Augmented Participation to Live Events through Social Network Content Enrichm...
Augmented Participation to Live Events through Social Network Content Enrichm...Daniele Dell'Aglio
 
An experience on empirical research about rdf stream
An experience on empirical research about rdf streamAn experience on empirical research about rdf stream
An experience on empirical research about rdf streamDaniele Dell'Aglio
 
A Survey of Temporal Extensions of Description Logics
A Survey of Temporal Extensions of Description LogicsA Survey of Temporal Extensions of Description Logics
A Survey of Temporal Extensions of Description LogicsDaniele Dell'Aglio
 
RDF Stream Processing Models (SR4LD2013)
RDF Stream Processing Models (SR4LD2013)RDF Stream Processing Models (SR4LD2013)
RDF Stream Processing Models (SR4LD2013)Daniele Dell'Aglio
 
Ontology based top-k query answering over massive, heterogeneous, and dynamic...
Ontology based top-k query answering over massive, heterogeneous, and dynamic...Ontology based top-k query answering over massive, heterogeneous, and dynamic...
Ontology based top-k query answering over massive, heterogeneous, and dynamic...Daniele Dell'Aglio
 
On correctness in RDF stream processor benchmarking
On correctness in RDF stream processor benchmarkingOn correctness in RDF stream processor benchmarking
On correctness in RDF stream processor benchmarkingDaniele Dell'Aglio
 
An Ontological Formulation and an OPM profile for Causality in Planning Appli...
An Ontological Formulation and an OPM profile for Causality in Planning Appli...An Ontological Formulation and an OPM profile for Causality in Planning Appli...
An Ontological Formulation and an OPM profile for Causality in Planning Appli...Daniele Dell'Aglio
 
P&MSP2012 - Version Control Systems
P&MSP2012 - Version Control SystemsP&MSP2012 - Version Control Systems
P&MSP2012 - Version Control SystemsDaniele Dell'Aglio
 
P&MSP2012 - Logging Frameworks
P&MSP2012 - Logging FrameworksP&MSP2012 - Logging Frameworks
P&MSP2012 - Logging FrameworksDaniele Dell'Aglio
 

Más de Daniele Dell'Aglio (20)

Distributed stream consistency checking
Distributed stream consistency checkingDistributed stream consistency checking
Distributed stream consistency checking
 
On web stream processing
On web stream processingOn web stream processing
On web stream processing
 
On a web of data streams
On a web of data streamsOn a web of data streams
On a web of data streams
 
Triplewave: a step towards RDF Stream Processing on the Web
Triplewave: a step towards RDF Stream Processing on the WebTriplewave: a step towards RDF Stream Processing on the Web
Triplewave: a step towards RDF Stream Processing on the Web
 
On unifying query languages for RDF streams
On unifying query languages for RDF streamsOn unifying query languages for RDF streams
On unifying query languages for RDF streams
 
RSEP-QL: A Query Model to Capture Event Pattern Matching in RDF Stream Proces...
RSEP-QL: A Query Model to Capture Event Pattern Matching in RDF Stream Proces...RSEP-QL: A Query Model to Capture Event Pattern Matching in RDF Stream Proces...
RSEP-QL: A Query Model to Capture Event Pattern Matching in RDF Stream Proces...
 
Summary of the Stream Reasoning workshop at ISWC 2016
Summary of the Stream Reasoning workshop at ISWC 2016Summary of the Stream Reasoning workshop at ISWC 2016
Summary of the Stream Reasoning workshop at ISWC 2016
 
On Unified Stream Reasoning
On Unified Stream ReasoningOn Unified Stream Reasoning
On Unified Stream Reasoning
 
On Unified Stream Reasoning - The RDF Stream Processing realm
On Unified Stream Reasoning - The RDF Stream Processing realmOn Unified Stream Reasoning - The RDF Stream Processing realm
On Unified Stream Reasoning - The RDF Stream Processing realm
 
Querying the Web of Data with XSPARQL 1.1
Querying the Web of Data with XSPARQL 1.1Querying the Web of Data with XSPARQL 1.1
Querying the Web of Data with XSPARQL 1.1
 
Augmented Participation to Live Events through Social Network Content Enrichm...
Augmented Participation to Live Events through Social Network Content Enrichm...Augmented Participation to Live Events through Social Network Content Enrichm...
Augmented Participation to Live Events through Social Network Content Enrichm...
 
An experience on empirical research about rdf stream
An experience on empirical research about rdf streamAn experience on empirical research about rdf stream
An experience on empirical research about rdf stream
 
A Survey of Temporal Extensions of Description Logics
A Survey of Temporal Extensions of Description LogicsA Survey of Temporal Extensions of Description Logics
A Survey of Temporal Extensions of Description Logics
 
RDF Stream Processing Models (SR4LD2013)
RDF Stream Processing Models (SR4LD2013)RDF Stream Processing Models (SR4LD2013)
RDF Stream Processing Models (SR4LD2013)
 
Ontology based top-k query answering over massive, heterogeneous, and dynamic...
Ontology based top-k query answering over massive, heterogeneous, and dynamic...Ontology based top-k query answering over massive, heterogeneous, and dynamic...
Ontology based top-k query answering over massive, heterogeneous, and dynamic...
 
On correctness in RDF stream processor benchmarking
On correctness in RDF stream processor benchmarkingOn correctness in RDF stream processor benchmarking
On correctness in RDF stream processor benchmarking
 
An Ontological Formulation and an OPM profile for Causality in Planning Appli...
An Ontological Formulation and an OPM profile for Causality in Planning Appli...An Ontological Formulation and an OPM profile for Causality in Planning Appli...
An Ontological Formulation and an OPM profile for Causality in Planning Appli...
 
P&MSP2012 - Version Control Systems
P&MSP2012 - Version Control SystemsP&MSP2012 - Version Control Systems
P&MSP2012 - Version Control Systems
 
P&MSP2012 - Unit Testing
P&MSP2012 - Unit TestingP&MSP2012 - Unit Testing
P&MSP2012 - Unit Testing
 
P&MSP2012 - Logging Frameworks
P&MSP2012 - Logging FrameworksP&MSP2012 - Logging Frameworks
P&MSP2012 - Logging Frameworks
 

Último

Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 

Último (20)

Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 

P&MSP2012 - Maven

  • 1. Planning and Managing Software Projects 2011-12 Maven Emanuele Della Valle, Lecturer: Daniele Dell’Aglio http://emanueledellavalle.org
  • 2. What is Maven?  Maven is a project management tool  Build automation tool  Deployment tool  Documentation generator  Report generator  ...  Even if the focus in on Java projects, other programming languages are supported (C#, Ruby, etc.) Planning and Managing Software Projects – Emanuele Della Valle
  • 3. Convention  Maven exploits the «Convention over configuration» approach  Assumption about the location of source code, test, resources  Assumption about the location of the output  Etc.  In general the conventions can be customized by users  Example: folder layout  src/main/java  src/main/resources  src/test/java  src/test/resources (http://maven.apache.org/guides/introduction/introduction-to-the-standard- directory-layout.html) Planning and Managing Software Projects – Emanuele Della Valle
  • 4. Project Object Model  The key element is the Project Object Model (POM)  It is a xml file (pom.xml) located in the root of the project folder  It contains the description of the project and all the information required by Maven  POM contains:  Project coordinates  Dependencies  Plugins  Repositories  A POM can be easily generated through mvn archetype:generate Planning and Managing Software Projects – Emanuele Della Valle
  • 5. Project coordinates  It is the “passport” of the artifact  The required information are:  Model version: the version of the POM  Group id: unique identificator of the group/organization that creates the artifact  Artifact id: unique identificator of the artifact  Version: the version of the artifact. If the artifact is a non-stable/under development component, -SNAPSHOT should be added after the version number  Another important information is the packaging  It influences the build lifecycles  Core packaging: jar (default), pom, maven-plugin, ejb, war, ear, rar, par Planning and Managing Software Projects – Emanuele Della Valle
  • 6. Project coordinates <project> <modelVersion>4.0.0</modelVersion> <groupId>pmsp.maven</groupId> <artifactId>firstexample</artifactId> <version>0.1</version> <packaging>jar</packaging> </project> Planning and Managing Software Projects – Emanuele Della Valle
  • 7. Dependencies  POM contains the description of the artifacts required by the project  Each dependency contains  The required artifact (identified by its coordinates)  The scope: controls the inclusion in the application and the availability in the classpath  compile (default): required for compilation, in the classpath and packaged  provided: required for compilation, in the classpath but not packaged (e.g. servlet.jar)  runtime: required for the execution but not for the compilation (e.g. JDBC, SLF4J bridges)  test: required only for testing, not packaged (e.g. JUnit)  system: like provided but with an explicit folder location Planning and Managing Software Projects – Emanuele Della Valle
  • 8. Dependencies  In general the dependency is transitive  It depends on the scope! http://maven.apache.org/guides/introduction/introductio n-to-dependency-mechanism.html#Dependency_Scope  If the project requires artifact A, and artifact A requires artifact B, then also artifact B will be included in the project  Users can disable the transitivity through the exclusion command Planning and Managing Software Projects – Emanuele Della Valle
  • 9. Dependencies … <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.10</version> <scope>test</scope> </dependency> … </dependencies> … Planning and Managing Software Projects – Emanuele Della Valle
  • 10. Plugins and Goals  The Maven core doesn't contain the logic to compile, test, package the software  Those features are provided through plugins • Examples: archetype, jar, compiler, surefire  As dependencies, projects should declare what are the required plugins ... <plugins> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>2.10</version> </plugin> </plugins> ... Planning and Managing Software Projects – Emanuele Della Valle
  • 11. Goals  Each plugin offers a set of goals  A goal is an executable task plugin goal 1 goal 2 goal 3  A goal can be invoked in the following way: mvn plugin:goal  Example: mvn archetype:generate Planning and Managing Software Projects – Emanuele Della Valle
  • 12. Phases and lifecycles  A phase is a step in the build lifecycle, which is an ordered sequence of phases. [Apache Maven manual]  Lifecycles can be used to execute mutliple operations  A lifecycle models a sequence of operations  Each step of a lifecycle is a phase  When a lifecycle is executed, plugin goals are bound to the phases  The goal bindings depends by the packaging!  Built-in lifecycle  default  clean  site (http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html) Planning and Managing Software Projects – Emanuele Della Valle
  • 13. Lifecycles: default (simplified) validate compile test package integration-test verify install deploy Planning and Managing Software Projects – Emanuele Della Valle
  • 14. Lifecycles: default (simplified) - packaging jar validate compile • compiler:compile test • surefire:test package • jar:jar integration-test verify install • install:install deploy • deploy:deploy Planning and Managing Software Projects – Emanuele Della Valle
  • 15. Lifecycles: default (simplified) - packaging pom validate compile test package • site:attach-descriptor integration-test verify install • install:install deploy • deploy:deploy Planning and Managing Software Projects – Emanuele Della Valle
  • 16. Repositories  Repositories are the places where dependencies and plugins are located  They are declared into the POM  When Maven runs, it connects to the repositories in order to retrieve the dependencies and the plugins  There is a special repository that is built by Maven on the local machine  It is located in these locations: – Unix: ~/.m2/repository – Win: C:%USER%.m2 • Its purpose is twofold: – It is a cache – Artifacts can be installed there (install:install) and be available for the other artifacts Planning and Managing Software Projects – Emanuele Della Valle
  • 17. Repositories <repositories> <repository> <id>central</id> <name>Maven Repository Switchboard</name> <layout>default</layout> <url>http://repo1.maven.org/maven2</url> <snapshots> <enabled>false</enabled> </snapshots> </repository> ... </repositories> <pluginRepositories> <pluginRepository> ... </pluginRepository> </pluginRepositories> Planning and Managing Software Projects – Emanuele Della Valle
  • 18. References  Maven http://maven.apache.org/guides/  Apache Maven 2 (Dzone RefCard) http://refcardz.dzone.com/refcardz/apache-maven-2  Maven: the complete reference (Sonatype) http://www.sonatype.com/books/mvnref- book/reference/  Maven – The definitive Guide (O’Reilly) http://www.amazon.com/Maven-Definitive-Guide- Sonatype-Company/dp/0596517335 Planning and Managing Software Projects – Emanuele Della Valle