Venkaiah Chowdary Koneru  Fazreil Amreen Abdul Jalil
Agenda• Maven• Repository• Complete Build solution
What’s the Problem?• Manual handling of external Jars• Inter-project dependencies• Running tests
What is Maven ?• A build tool• Uniform build system• Provides quality project information• Transparent migration to new fe...
Conceptual Model• Maven maintains model of a project• Unique set of coordinates to a project• Almost zero effort• Encourag...
Default Directory Structure               Structure is based on the archetypes               definition                   ...
POM• Fundamental unit of work in maven• An XML file• Consists  – Project information  – Project relationships  – Build set...
POM         <project ...>                  <parent />                  <groupId />• Fundamental unit of work in maven     ...
POM• Convention over Configuration• Maven incorporates this by providing  default behavior for projects     <project>     ...
Life Cycle• Contains phases in specific order• Phase is made up of goals• 3 built-in life cycles  – default  – clean and  ...
Life Cycle - Default  validate  initialize                 test-  compile                 test    package               co...
Multi-Module Projects• Why use a modular architecture ?  – Separation of concerns  – Easier to test  – Flexible• Reusing t...
Multi-Module Projects                                  Organization or team wide                                  properti...
Multi-Module Projects• Organize your builds• Speed up builds• Speedup test process
Maven Repository• Holds the build artifacts and dependencies• Two types of repositories  – Local  – Remote
Local Repository• Local cache for artifacts• Can erase it completely• Useful for offline builds• Resides in User home’s .m...
Remote Repository• Central repository to host all artifacts• Local repository downloads from the  central repository hoste...
Internal Repository• Corporate repository• Proxy for remote repositories                Local Repository               (.m...
What is Artifactory?• It is a MAVEN repository• Think of it as the ‘SVN’ for libraries.• It is the place to obtain this in...
Do we need our own maven  repo?• Because we want to host our own  libraries.• And we would like to make our libraries  ava...
Extra notes• Artifactory acts as a proxy to the outside  repository.• Dependencies requested to Artifactory will  be cache...
Build solution• Complete end-to-end solution• 5 open source projects  – Maven  – Subversion  – Hudson  – Artifactory  – So...
Ecosystem• A typical maven project ecosystem                      Distribute artifacts                                    ...
Maven Release Cycle• Develop against snapshot versions• Release stable versions• Automated releases  – Update version numb...
Upcoming SlideShare
Loading in …5
×

How maven makes your development group look like a bunch of professionals.

852 views

Published on

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
852
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
17
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • Teaming as a way of life!!
  • Maven IntroductionWhat is maven ?why ?Maven vs AntBasicsDependenciesMaven customizationIDE integrationMulti-module projects - creating multi module projects - naming conventions - Group id, artifact id
  • External jarsWhere to store themWhat versionDependency on other jarsRunning test - developers don’t have time or forget tests before commit
  • Majorityof the maven users call maven as a “build tool” – A tool used to build deployable artifacts from source code.Build tool such as Ant is focused solely on preprocessing, compilation, packaging, testing and distribution.Uniform build system (POM)this definition of a model for every project enables features such asDependency managementRemote repositoriesUniversal reuse of build logicTool portability / integrationLife CycleCompiling source codeExecuting test casesPackaging distributionAnd many others
  • Model – Provides default behavior for projectsZERO effortPut sources in source directoryDefine relationships between modulesModularDefine the relationship between modulesInherit properties and behavior from parent projectsOrganize build with multi-module projects
  • Archetype is a Maven project templating toolkit.An archetype is defined as an original pattern or model from which all other things of the same kind are made. 
  • POMIt is what makes your project a maven project
  • POMIt is what makes your project a maven project
  • Convention over configurationSystems, libraries, and frameworks should assume reasonable defaults.Source, resources, test, classes and etc…Defined life cycle and a set of common pluginsSet of common plugin’s knows how to build and assemble the software …
  • Maven 2.0 is based around the central concept of a build lifecycle. What this means is that the process for building and distributing a particular artifact (project) is clearly defined.Phase represents a specific stageGoal represents a specific taskDefault : handles your project deploymentClean: project cleaningSite: project’s site documentation
  • WHY?Separation of concernsEasier to testFlexibleDependenciesDefine the relationships between modules InheritanceInherit properties and behaviour from parent projectsAggregationOrganize builds with multi-module projects
  • Inheritance in actionSuper POM is always the base parent like Object in java
  • Organize : - coordinates builds and stage build process (build pipelines)Test process:Not only unit tests.Integration test, parallelize long running integration tests
  • Why not store JAR’s in CVS ?Maven tries to promote the notion of a user local repository where JARs, or any project artifacts, can be stored and used for any number of builds.Uses less storageMakes checking of a project quicker
  • It is a MAVEN repositoryThink of it as the ‘SVN’ for libraries.It is the place to obtain this information:&lt;dependency&gt; &lt;groupId&gt;my.mimos.util&lt;/groupId&gt; &lt;artifactId&gt;dbutil&lt;/artifactId&gt; &lt;version&gt;0.1&lt;/version&gt;&lt;/dependency&gt;
  • Because we want to host our own libraries.And we would like to make our libraries available to the whole MIMOS networkYes, we can control the access.
  • Artifactory acts as a proxy to the outside repository.Dependencies requested to Artifactory will be cached in Artifactory for quick retrieval.Log in using MIMOS AD Login.
  • Maven:Describe project, generate artifacts, artifact versioningSubversion:To collectively own code and integrate often, source code repository is necessaryCI server:After check-in, a CI server will check the code out, compile and run all the unit tests.Artifactory:It enables both release and snapshot artifacts. It is valuable to keep metrics about source code (code quality).
  • To automate, needMaven release plugin and scm details in POM xmlEach release produces a new time-stamped artifactSnapshot versions are identified by the SNAPSHOT keywordStable, tested releaseEach artifact is unique
  • How maven makes your development group look like a bunch of professionals.

    1. 1. Venkaiah Chowdary Koneru Fazreil Amreen Abdul Jalil
    2. 2. Agenda• Maven• Repository• Complete Build solution
    3. 3. What’s the Problem?• Manual handling of external Jars• Inter-project dependencies• Running tests
    4. 4. What is Maven ?• A build tool• Uniform build system• Provides quality project information• Transparent migration to new features• Guidelines for best practices development
    5. 5. Conceptual Model• Maven maintains model of a project• Unique set of coordinates to a project• Almost zero effort• Encourages modular design
    6. 6. Default Directory Structure Structure is based on the archetypes definition Source folders Test related Source folders Generated class files and artifacts
    7. 7. POM• Fundamental unit of work in maven• An XML file• Consists – Project information – Project relationships – Build settings – Build environment
    8. 8. POM <project ...> <parent /> <groupId />• Fundamental unit of work in maven <artifactId /> <version /> <packaging /> <modules> … </modules>• An XML file <propertie> ... </properties> <developers /> <contributors /> <scm> ... </scm>• Consists <build> <plugins> ... </plugins> – Project information </build> <dependencies> ... </dependencies> – Project relationships </repositories> <repositories> ... <pluginRepositories> ... </pluginRepositories> – Build settings ... </profiles> <profiles> <reporting> ... </reporting> – Build environment </project>
    9. 9. POM• Convention over Configuration• Maven incorporates this by providing default behavior for projects <project> <modelVersion>4.0.0</modelVersion> <groupId>my.fazreil.projects</groupId> <artifactId>fireglass</artifactId> <version>0.0.1</version> </project> Just put your sources in the correct directory
    10. 10. Life Cycle• Contains phases in specific order• Phase is made up of goals• 3 built-in life cycles – default – clean and – test
    11. 11. Life Cycle - Default validate initialize test- compile test package compile deploy install
    12. 12. Multi-Module Projects• Why use a modular architecture ? – Separation of concerns – Easier to test – Flexible• Reusing the configuration – Inheritance – Dependencies• Aggregation
    13. 13. Multi-Module Projects Organization or team wide properties archetype Project wide properties Project Aggregation module1 module2 Module specific properties
    14. 14. Multi-Module Projects• Organize your builds• Speed up builds• Speedup test process
    15. 15. Maven Repository• Holds the build artifacts and dependencies• Two types of repositories – Local – Remote
    16. 16. Local Repository• Local cache for artifacts• Can erase it completely• Useful for offline builds• Resides in User home’s .m2/ folder
    17. 17. Remote Repository• Central repository to host all artifacts• Local repository downloads from the central repository hosted @ maven.org Local Repository Search order (.m2repository) Remote repository (http://repo1.maven.org/maven2)
    18. 18. Internal Repository• Corporate repository• Proxy for remote repositories Local Repository (.m2repository) Search order Internal Proxy (http://{repository url}) Remote repository (http://repo1.maven.org/maven2)
    19. 19. What is Artifactory?• It is a MAVEN repository• Think of it as the ‘SVN’ for libraries.• It is the place to obtain this information: <dependency> <groupId>my.fazreil.project</groupId> <artifactId>fireglass</artifactId> <version>0.0.1</version> </dependency>
    20. 20. Do we need our own maven repo?• Because we want to host our own libraries.• And we would like to make our libraries available to the local network• Yes, we can control the access.
    21. 21. Extra notes• Artifactory acts as a proxy to the outside repository.• Dependencies requested to Artifactory will be cached in Artifactory for quick retrieval.
    22. 22. Build solution• Complete end-to-end solution• 5 open source projects – Maven – Subversion – Hudson – Artifactory – Sonar
    23. 23. Ecosystem• A typical maven project ecosystem Distribute artifacts Publish artifacts Source code Automated builds metrics changes
    24. 24. Maven Release Cycle• Develop against snapshot versions• Release stable versions• Automated releases – Update version numbers to next SNAPSHOT versions

    ×