A JJTV tool night presentation
Tomer Gabel, November 2012
 Maven is not news…

 … but it’s not well-understood either

 Let’s go back to basics
 A lifecycle management tool
  Not just a build system

 Declarative
  Not a script!

 Modular
  Everything is a plugin
Phases                                                                              Goals
          • process-resources
compile   • compile                                                                resources:resources   compiler:compile

                                • process-test-resources
             test               • test-compile
                                • test




                            package                • prepare-package                 resources:test-      compiler:test-
                                                   • package
                                                                                        resources           compile
                                                                       • verify
                                                    deploy             • install
                                                                       • deploy




                                                                                      surefire:test          war:war
Hierarchy


               POM


Dependencies         Configuration
   XML
     *sigh* … yeah


   Artifact descriptor

   Hierarchy

   Dependencies
   POMs reference POMs

     Group, artifact, version


   Repository lookup

     Local repository
      (“cache”)

     Remote repositories
   Convention over configuration

     Stick to the conventions if possible

   Keep it simple

     Avoid complex setups (e.g. multiple repositories)

     Avoid feature creep (stick to common plugins)
   Useful links
     Maven home: http://maven.apache.org
     Central repository: http://search.maven.org


   Me!
     Blog: http://www.tomergabel.com
     Twitter: @tomerg
     LinkedIn: http://il.linkedin.com/in/tomergabel

Maven for Dummies

  • 1.
    A JJTV toolnight presentation Tomer Gabel, November 2012
  • 2.
     Maven isnot news…  … but it’s not well-understood either  Let’s go back to basics
  • 3.
     A lifecyclemanagement tool  Not just a build system  Declarative  Not a script!  Modular  Everything is a plugin
  • 4.
    Phases Goals • process-resources compile • compile resources:resources compiler:compile • process-test-resources test • test-compile • test package • prepare-package resources:test- compiler:test- • package resources compile • verify deploy • install • deploy surefire:test war:war
  • 5.
    Hierarchy POM Dependencies Configuration
  • 6.
    XML  *sigh* … yeah  Artifact descriptor  Hierarchy  Dependencies
  • 7.
    POMs reference POMs  Group, artifact, version  Repository lookup  Local repository (“cache”)  Remote repositories
  • 8.
    Convention over configuration  Stick to the conventions if possible  Keep it simple  Avoid complex setups (e.g. multiple repositories)  Avoid feature creep (stick to common plugins)
  • 9.
    Useful links  Maven home: http://maven.apache.org  Central repository: http://search.maven.org  Me!  Blog: http://www.tomergabel.com  Twitter: @tomerg  LinkedIn: http://il.linkedin.com/in/tomergabel