Maven software tool

download Maven software tool

of 16

Transcript of Maven software tool

  • 8/12/2019 Maven software tool

    1/16

    Synopsis

    IntroductionWhy Maven?PrerequisitesProject StructurePOMPhasesDependency Management

    Project StructurePluginsInheritanceMulti Module Support

  • 8/12/2019 Maven software tool

    2/16

    IntroductionSoftware management and comprehension tool!ased on Project O"ject Model #POM$ % manage project "uild& reporting& and

    documentation from a central piece of information

  • 8/12/2019 Maven software tool

    3/16

    Why Maven?

    'asy !uild Process(niform !uild System

    )uality Project Information

    *uidelines for !est Practices Development

    +isi"ility

    ,e usa"ility

    Maintaina"ility

  • 8/12/2019 Maven software tool

    4/16

    POMA fundamental unit of work in Maven

    An XML file that contains information about project and configuration details

    used by Maven to build the project

    Already built into the Maven engine

    Contains:

    -ame and +ersion.rtifact /ype

    Source 0ode 1ocations

    Dependencies

    Plug%ins

    Profiles #.lternate "uild configurations$

  • 8/12/2019 Maven software tool

    5/16

  • 8/12/2019 Maven software tool

    6/16

  • 8/12/2019 Maven software tool

    7/16

    Dependency Management

    /he dependency management model for projects whose componentsdeveloped "y different project teams

    Supports continuous independent development and refinement of all dependentModules

    Maven local:Directory on your dis2#located at Homeirectory3m43repository$.cts as a high%performance local cache& storing artifacts downloaded

    Remote repositories:.ccessed over the networ2 5ou can maintain a list of remote repositories to

    use in your settings6ml configuration fileDependencies are specified in 7dependencies8 elements within a pom6ml fileProject dependencies are stored on repository servers #simply calledrepositories in

  • 8/12/2019 Maven software tool

    8/16

  • 8/12/2019 Maven software tool

    9/16

    Eg:

    7dependencies87dependency8

    7groupId8junit73groupId87artifactId8junit73artifactId8

    7version89:;73version873dependency873dependencies8

  • 8/12/2019 Maven software tool

    10/16

    Project Structure

  • 8/12/2019 Maven software tool

    11/16

    Project Structure#cont$Target:Default wor2 directory

    src:.ll project source files go in this directory

    src/main:.ll sources that go into primary artifact

    src/test:.ll sources contri"uting to testing project

    src/main/java:.ll java source files

    src/main/webapp:.ll we" source files

    src/main/resources:.ll non compiled source files

    src/test/java:.ll java test source files

    src/test/resources:.ll non compiled test source files

  • 8/12/2019 Maven software tool

    12/16

    *roupID= .r"itrary project grouping identifier

    .rtfiactId= .r"itrary name of project

    +ersion= +ersion of project

    >ormat = Major@Minor@Maintanence@

    AS-.PSBO/ A Identify in development

    *.+ Synta6=

    .0.0

    mven-trining

    org.lds.trining

    1.0

    jar

    Project Structure#cont$

  • 8/12/2019 Maven software tool

    13/16

    Pac2aging

    !uild type identified using the Cpac2aging element

    '6ample pac2aging types=

    pom& jar& war& ear& custom

    Default is jar

    .0.0

    mven-trining org.lds.trining

    1.0

    jar

  • 8/12/2019 Maven software tool

    14/16

    7dependencies87dependency8

    7groupId8comi"mdevwor2s73groupId8

    7artifactId8OpsImp73artifactId87version8;E%

    S-.PSBO/73version873dependency8

    73dependencies8

    SNAPSHOT

    S-.PSBO/ tells Maven F under development % fetch the latest copy of theartifact availa"le

  • 8/12/2019 Maven software tool

    15/16

    Plugins

    When you use Maven&wor2 is performed e6clusively via plug%ins

  • 8/12/2019 Maven software tool

    16/16

    Multi module supportMaven has ;stclass multi%module support

    'ach maven project creates ; primary artifact

    . parent pom is used to group modules

    7project8

    7pac2aging8pom73pac2aging8

    mo!ules"

    mo!ule"maven#training/mo!ule"

    mo!ule"maven#training#web/mo!ule" /mo!ules"

    73project8