SlideShare a Scribd company logo
1 of 191
Building Android apps with Maven

Fabrizio Giudici
Senior Java Architect
Tidalwave, NetBeans Dream Team
Agenda




         2
Agenda
• Introducing Maven




                      2
Agenda
• Introducing Maven
• The Android Plugin for Maven




                                 2
Agenda
• Introducing Maven
• The Android Plugin for Maven
• A real world project




                                 2
Agenda
• Introducing Maven
• The Android Plugin for Maven
• A real world project




                                 2
Agenda
• Introducing Maven
• The Android Plugin for Maven
• A real world project




                                 2
Agenda
• Introducing Maven
• The Android Plugin for Maven
• A real world project




                                 2
Agenda
• Introducing Maven
• The Android Plugin for Maven
• A real world project
• Maven: why and when?




                                 2
Agenda
• Introducing Maven
• The Android Plugin for Maven
• A real world project
• Maven: why and when?
• Question time




                                 2
Agenda
• Introducing Maven
• The Android Plugin for Maven
• A real world project
• Maven: why and when?
• Question time




• Thanks to Manfred Moser (Simpligility) for providing some preso stuff


                                                                          2
About Fabrizio




                 3
About Fabrizio
• Senior Architect, Mentor, Technical Writer
 –Working with Java (all the editions, plus exotic stuff) since 1996
 –Frequent speaker at J1, Devoxx, Jazoon, JUGs
 –Blogger at Java.Net, Most Valuable Blogger at DZone
• Member of the NetBeans Dream Team




                                                                   3
About Fabrizio
• Senior Architect, Mentor, Technical Writer
 –Working with Java (all the editions, plus exotic stuff) since 1996
 –Frequent speaker at J1, Devoxx, Jazoon, JUGs
 –Blogger at Java.Net, Most Valuable Blogger at DZone
• Member of the NetBeans Dream Team
• Co-leader of JUG Milano




                                                                   3
About Fabrizio
• Senior Architect, Mentor, Technical Writer
 –Working with Java (all the editions, plus exotic stuff) since 1996
 –Frequent speaker at J1, Devoxx, Jazoon, JUGs
 –Blogger at Java.Net, Most Valuable Blogger at DZone
• Member of the NetBeans Dream Team
• Co-leader of JUG Milano
• In the past years shifting from “mere” design and
  architecture...



                                                                   3
About Fabrizio
• Senior Architect, Mentor, Technical Writer
 –Working with Java (all the editions, plus exotic stuff) since 1996
 –Frequent speaker at J1, Devoxx, Jazoon, JUGs
 –Blogger at Java.Net, Most Valuable Blogger at DZone
• Member of the NetBeans Dream Team
• Co-leader of JUG Milano
• In the past years shifting from “mere” design and
  architecture...
• ... to method & software factory optimization


                                                                   3
Introducing Maven
         Maven in four slides!
Maven vs Ant




               5
Maven vs Ant
• Maven is truly like cats




                             5
Maven vs Ant
• Maven is truly like cats
  –“Cats, either you love them or hate them”




                                               5
Maven vs Ant
• Maven is truly like cats
  –“Cats, either you love them or hate them”




                                               5
Maven vs Ant
• Maven is truly like cats
  –“Cats, either you love them or hate them”




                                               5
Maven vs Ant
• Maven is truly like cats
  –“Cats, either you love them or hate them”




                                               5
Maven vs Ant
• Maven is truly like cats
  –“Cats, either you love them or hate them”
• Ant: a scripting interpreter, build-oriented DSL




                                                     5
Maven vs Ant
• Maven is truly like cats
  –“Cats, either you love them or hate them” procedural
• Ant: a scripting interpreter, build-oriented DSL




                                                          5
Maven vs Ant
• Maven is truly like cats
  –“Cats, either you love them or hate them” procedural
• Ant: a scripting interpreter, build-oriented DSL
• Maven: a standard build workflow executor




                                                          5
Maven vs Ant
• Maven is truly like cats
  –“Cats, either you love them or hate them” procedural
• Ant: a scripting interpreter, build-oriented DSL
• Maven: a standard build workflow executor
                                            declarative




                                                          5
Maven vs Ant
• Maven is truly like cats
  –“Cats, either you love them or hate them” procedural
• Ant: a scripting interpreter, build-oriented DSL
• Maven: a standard build workflow executor
                                          declarative
• POM: Project Object Model




                                                          5
Maven vs Ant
• Maven is truly like cats
  –“Cats, either you love them or hate them” procedural
• Ant: a scripting interpreter, build-oriented DSL
• Maven: a standard build workflow executor
                                          declarative
• POM: Project Object Model
  –Project structure, language, packaging




                                                          5
Maven vs Ant
• Maven is truly like cats
  –“Cats, either you love them or hate them” procedural
• Ant: a scripting interpreter, build-oriented DSL
• Maven: a standard build workflow executor
                                          declarative
• POM: Project Object Model
  –Project structure, language, packaging
  –Dependencies




                                                          5
Maven vs Ant
• Maven is truly like cats
  –“Cats, either you love them or hate them” procedural
• Ant: a scripting interpreter, build-oriented DSL
• Maven: a standard build workflow executor
                                          declarative
• POM: Project Object Model
  –Project structure, language, packaging
  –Dependencies
  –Other metadata (license, developers, mailing list, etc...)




                                                            5
Maven vs Ant
• Maven is truly like cats
  –“Cats, either you love them or hate them” procedural
• Ant: a scripting interpreter, build-oriented DSL
• Maven: a standard build workflow executor
                                          declarative
• POM: Project Object Model
  –Project structure, language, packaging
  –Dependencies
  –Other metadata (license, developers, mailing list, etc...)
• Plugin oriented

                                                            5
Maven vs Ant
• Maven is truly like cats
  –“Cats, either you love them or hate them” procedural
• Ant: a scripting interpreter, build-oriented DSL
• Maven: a standard build workflow executor
                                          declarative
• POM: Project Object Model
  –Project structure, language, packaging
  –Dependencies
  –Other metadata (license, developers, mailing list, etc...)
• Plugin oriented
• FLOSS (Apache License v2.0)
                                                            5
Phases, plugins, goals




                         6
Phases, plugins, goals
• A lifecycle is a sequence of phases




                           validate
     The




                            compile

                                test
      “defa




                               package
       ult” l




                            integration-test

                                      verify
              ifecy




                                       install
                    c le




                                        deploy


                                                 6
Phases, plugins, goals
• A lifecycle is a sequence of phases
• Every plugin can execute goals



                                                 compiler
                           validate               plugin
                                                            surefire
     The




                            compile
                                                  compile    plugin
                                test
      “defa




                               package
                                                              test

                                                                      deploy
       ult” l




                            integration-test

                                      verify                          plugin
              ifecy




                                       install
                                                                      deploy
                    c le




                                        deploy


                                                                               6
Phases, plugins, goals
• A lifecycle is a sequence of phases
• Every plugin can execute goals
                                   mvn                                compiler:compile
• Goals can be executed manually...

                                                 compiler
                           validate               plugin
                                                            surefire
     The




                            compile
                                                  compile    plugin
                                test
      “defa




                               package
                                                              test

                                                                       deploy
       ult” l




                            integration-test

                                      verify                           plugin
              ifecy




                                       install
                                                                        deploy
                    c le




                                        deploy


                                                                                    6
Phases, plugins, goals
• A lifecycle is a sequence of phases
• Every plugin can execute goals
                                   mvn                                compiler:compile
• Goals can be executed manually...
• ... or attached to phases
                                                 compiler
                           validate               plugin
                                                            surefire
     The




                            compile
                                                  compile    plugin
                                test
      “defa




                               package
                                                              test

                                                                       deploy
       ult” l




                            integration-test

                                      verify                           plugin
              ifecy




                                       install
                                                                        deploy
                    c le




                                        deploy


                                                                                    6
Phases, plugins, goals
• A lifecycle is a sequence of phases
• Every plugin can execute goals
                                     mvn compiler:compile
• Goals can be executed manually...
• ... or attached to phases      mvn install


                                                  compiler
                            validate               plugin
                                                             surefire
      The




                             compile
                                                   compile    plugin
                                 test
       “defa




                                package
                                                               test

                                                                       deploy
        ult” l




                             integration-test

                                       verify                          plugin
               ifecy




                                        install
                                                                       deploy
                     c le




                                         deploy


                                                                                6
Artifacts and repositories




                             7
Artifacts and repositories
• A project is usually composed by many modules




                                              7
Artifacts and repositories
• A project is usually composed by many modules
• Each module




                                              7
Artifacts and repositories
• A project is usually composed by many modules
• Each module
 –possibly depends on other modules’ artifacts




                                                 7
Artifacts and repositories
• A project is usually composed by many modules
• Each module
 –possibly depends on other modules’ artifacts
 –produces its own artifact (maybe made of multiple files)




                                                         7
Artifacts and repositories
• A project is usually composed by many modules
• Each module
  –possibly depends on other modules’ artifacts
  –produces its own artifact (maybe made of multiple files)
• Each artifact




                                                          7
Artifacts and repositories
• A project is usually composed by many modules
• Each module
  –possibly depends on other modules’ artifacts
  –produces its own artifact (maybe made of multiple files)
• Each artifact
  –has got unique coordinates




                                                          7
Artifacts and repositories
• A project is usually composed by many modules
• Each module
  –possibly depends on other modules’ artifacts
  –produces its own artifact (maybe made of multiple files)
• Each artifact
  –has got unique coordinates
    • groupId, artifactId, version, packaging, classifier




                                                            7
Artifacts and repositories
• A project is usually composed by many modules
• Each module
  –possibly depends on other modules’ artifacts
  –produces its own artifact (maybe made of multiple files)
• Each artifact
  –has got unique coordinates
    • groupId, artifactId, version, packaging, classifier
  –can be retrieved from a local/remote repository




                                                            7
Artifacts and repositories
• A project is usually composed by many modules
• Each module
  –possibly depends on other modules’ artifacts
  –produces its own artifact (maybe made of multiple files)
• Each artifact
  –has got unique coordinates
    • groupId, artifactId, version, packaging, classifier
  –can be retrieved from a local/remote repository
  –can be deployed to a local/remote repository


                                                            7
Artifacts and repositories
• A project is usually composed by many modules
• Each module
  –possibly depends on other modules’ artifacts
  –produces its own artifact (maybe made of multiple files)
• Each artifact        mvn install
                                         mvn deploy
  –has got unique coordinates
    • groupId, artifactId, version, packaging, classifier
  –can be retrieved from a local/remote repository
  –can be deployed to a local/remote repository


                                                            7
Artifacts and repositories
• A project is usually composed by many modules
• Each module
  –possibly depends on other modules’ artifacts
  –produces its own artifact (maybe made of multiple files)
• Each artifact        mvn install
                                         mvn deploy
  –has got unique coordinates
    • groupId, artifactId, version, packaging, classifier
  –can be retrieved from a local/remote repository
  –can be deployed to a local/remote repository
• Local repo is at $HOME/.m2/repository

                                                            7
Artifacts and repositories
• A project is usually composed by many modules
• Each module
  –possibly depends on other modules’ artifacts
  –produces its own artifact (maybe made of multiple files)
• Each artifact        mvn install
                                         mvn deploy
  –has got unique coordinates
    • groupId, artifactId, version, packaging, classifier
  –can be retrieved from a local/remote repository
  –can be deployed to a local/remote repository
• Local repo is at $HOME/.m2/repository
• Remote repo is the internet, or your own, or both
                                                            7
Artifacts and repositories
• A project is usually composed by many modules
• Each module
  –possibly depends on other modules’ artifacts
  –produces its own artifact (maybe made of multiple files)
• Each artifact        mvn install
                                         mvn deploy
  –has got unique coordinates
    • groupId, artifactId, version, packaging, classifier
  –can be retrieved from a local/remote repository
  –can be deployed to a local/remote repository
• Local repo is at $HOME/.m2/repository
• Remote repo is the internet, or your own, or both
                                                            7
Project structure




                    8
Project structure
• Master POM



                    Master
                     POM




                             8
Project structure
• Master POM
• Includes Module POMs             includes




                         Master
                          POM           Module 1
                                         POM



                         Modules        Module 2
                          POM            POM



                                        Module 3
                                         POM

                                                   8
Project structure
• Master POM
• Includes Module POMs             includes
                                     inherits
• POMs can inherit

                         Master
                          POM            Module 1
                                          POM



                         Modules         Module 2
                          POM             POM



                                         Module 3
                                          POM

                                                    8
Project structure
• Master POM
• Includes Module POMs             includes
                                     inherits
• POMs can inherit
 –DRY
                         Master
                          POM            Module 1
                                          POM



                         Modules         Module 2
                          POM             POM



                                         Module 3
                                          POM

                                                    8
Project structure
• Master POM               Super
• Includes Module POMs      POM     includes
                                      inherits
• POMs can inherit
 –DRY
                          Master
• A Super POM is really    POM            Module 1
                                           POM
  valuable

                          Modules         Module 2
                           POM             POM



                                          Module 3
                                           POM

                                                     8
The Android
Plugin for Maven
The maven-android-plugin




                           10
The maven-android-plugin
• maven-android-plugin




                           10
The maven-android-plugin
• maven-android-plugin
 –Also android-maven-plugin (3.0)




                                    10
The maven-android-plugin
• maven-android-plugin
 –Also android-maven-plugin (3.0)
 –Made by Jayway (jayway.se), FLOSS




                                      10
The maven-android-plugin
• maven-android-plugin
 –Also android-maven-plugin (3.0)
 –Made by Jayway (jayway.se), FLOSS
• Makes it possible to call Android SDK tools




                                                10
The maven-android-plugin
• maven-android-plugin
 –Also android-maven-plugin (3.0)
 –Made by Jayway (jayway.se), FLOSS
• Makes it possible to call Android SDK tools
• Goals:




                                                10
The maven-android-plugin
• maven-android-plugin
 –Also android-maven-plugin (3.0)
 –Made by Jayway (jayway.se), FLOSS
• Makes it possible to call Android SDK tools
• Goals:
 –generate-sources, apk, apklib, dex, zipalign, unpack




                                                     10
The maven-android-plugin
• maven-android-plugin
 –Also android-maven-plugin (3.0)
 –Made by Jayway (jayway.se), FLOSS
• Makes it possible to call Android SDK tools
• Goals:
 –generate-sources, apk, apklib, dex, zipalign, unpack
 –deploy, deploy-dependencies, redeploy, undeploy




                                                     10
The maven-android-plugin
• maven-android-plugin
 –Also android-maven-plugin (3.0)
 –Made by Jayway (jayway.se), FLOSS
• Makes it possible to call Android SDK tools
• Goals:
 –generate-sources, apk, apklib, dex, zipalign, unpack
 –deploy, deploy-dependencies, redeploy, undeploy
 –emulator-start, emulator-stop, run




                                                     10
The maven-android-plugin
• maven-android-plugin
 –Also android-maven-plugin (3.0)
 –Made by Jayway (jayway.se), FLOSS
• Makes it possible to call Android SDK tools
• Goals:
 –generate-sources, apk, apklib, dex, zipalign, unpack
 –deploy, deploy-dependencies, redeploy, undeploy
 –emulator-start, emulator-stop, run
 –push, pull


                                                     10
The maven-android-plugin
• maven-android-plugin
 –Also android-maven-plugin (3.0)
 –Made by Jayway (jayway.se), FLOSS
• Makes it possible to call Android SDK tools
• Goals:
 –generate-sources, apk, apklib, dex, zipalign, unpack
 –deploy, deploy-dependencies, redeploy, undeploy
 –emulator-start, emulator-stop, run
 –push, pull
• Supports native development (NDK)
                                                     10
The maven-android-plugin
• maven-android-plugin
 –Also android-maven-plugin (3.0)
 –Made by Jayway (jayway.se), FLOSS
• Makes it possible to call Android SDK tools
• Goals:
 –generate-sources, apk, apklib, dex, zipalign, unpack
 –deploy, deploy-dependencies, redeploy, undeploy
 –emulator-start, emulator-stop, run
 –push, pull
• Supports native development (NDK)
 –Not covered in this talk
                                                     10
The MorseFlash demo app




                          11
The MorseFlash demo app
• A very simple application, perfect starter




                                               11
The MorseFlash demo app
• A very simple application, perfect starter
  –Generates Morse signals out of a word




                                               11
The MorseFlash demo app
• A very simple application, perfect starter
  –Generates Morse signals out of a word
  –Note that the POMs are naive (more later)




                                               11
The MorseFlash demo app
• A very simple application, perfect starter
  –Generates Morse signals out of a word
  –Note that the POMs are naive (more later)
• Made of four POMs




                                               11
The MorseFlash demo app
• A very simple application, perfect starter
  –Generates Morse signals out of a word
  –Note that the POMs are naive (more later)
• Made of four POMs
  –The Master POM




                                               11
The MorseFlash demo app
• A very simple application, perfect starter
  –Generates Morse signals out of a word
  –Note that the POMs are naive (more later)
• Made of four POMs
  –The Master POM
  –The Library (pure JSE code for Morse coding)




                                                  11
The MorseFlash demo app
• A very simple application, perfect starter
  –Generates Morse signals out of a word
  –Note that the POMs are naive (more later)
• Made of four POMs
  –The Master POM
  –The Library (pure JSE code for Morse coding)
  –The application




                                                  11
The MorseFlash demo app
• A very simple application, perfect starter
  –Generates Morse signals out of a word
  –Note that the POMs are naive (more later)
• Made of four POMs
  –The Master POM
  –The Library (pure JSE code for Morse coding)
  –The application
  –Integration tests




                                                  11
The MorseFlash demo app
• A very simple application, perfect starter
  –Generates Morse signals out of a word
  –Note that the POMs are naive (more later)
• Made of four POMs
  –The Master POM
  –The Library (pure JSE code for Morse coding)
  –The application
  –Integration tests
• Includes support for signing and obfuscating


                                                  11
The MorseFlash demo app
• A very simple application, perfect starter
  –Generates Morse signals out of a word
  –Note that the POMs are naive (more later)
• Made of four POMs
  –The Master POM
  –The Library (pure JSE code for Morse coding)
  –The application
  –Integration tests
• Includes support for signing and obfuscating
• Two profiles, “standard” and “release”
                                                  11
Android Libraries
• Support for Android apklib
 –zipped file with both code and resources (including
  R.java)
 –can be used for reusing code
• The Android Maven plugin supports it
 –even though sources are not layout in the standard way
• Personally I don’t like it
• More about reusing libraries later



                                                        12
A real world
     project
      blueBill Mobile
blueBill Mobile




                  14
blueBill Mobile
• For bird(watch)ers




                       14
blueBill Mobile
• For bird(watch)ers
 –Record geotagged observations on the field




                                               14
blueBill Mobile
• For bird(watch)ers
 –Record geotagged observations on the field
 –Browse fact sheets and multimedia resources




                                                14
blueBill Mobile
• For bird(watch)ers
 –Record geotagged observations on the field
 –Browse fact sheets and multimedia resources
• Sophisticated data structure




                                                14
blueBill Mobile
• For bird(watch)ers
 –Record geotagged observations on the field
 –Browse fact sheets and multimedia resources
• Sophisticated data structure
 –RDF, semantic web




                                                14
blueBill Mobile
• For bird(watch)ers
 –Record geotagged observations on the field
 –Browse fact sheets and multimedia resources
• Sophisticated data structure
 –RDF, semantic web
• Reuses code from JSE and JEE projects




                                                14
blueBill Mobile
• For bird(watch)ers
 –Record geotagged observations on the field
 –Browse fact sheets and multimedia resources
• Sophisticated data structure
 –RDF, semantic web
• Reuses code from JSE and JEE projects
• Uses some libraries from the NetBeans Platform




                                                14
blueBill Mobile
• For bird(watch)ers
 –Record geotagged observations on the field
 –Browse fact sheets and multimedia resources
• Sophisticated data structure
 –RDF, semantic web
• Reuses code from JSE and JEE projects
• Uses some libraries from the NetBeans Platform
 –for implementing DCI (Data, Context, Interaction)




                                                      14
blueBill Mobile
• For bird(watch)ers
 –Record geotagged observations on the field
 –Browse fact sheets and multimedia resources
• Sophisticated data structure
 –RDF, semantic web
• Reuses code from JSE and JEE projects
• Uses some libraries from the NetBeans Platform
 –for implementing DCI (Data, Context, Interaction)
• 3 projects (core, resources, Android app)

                                                      14
blueBill Mobile
• For bird(watch)ers
 –Record geotagged observations on the field
 –Browse fact sheets and multimedia resources
• Sophisticated data structure
 –RDF, semantic web
• Reuses code from JSE and JEE projects
• Uses some libraries from the NetBeans Platform
 –for implementing DCI (Data, Context, Interaction)
• 3 projects (core, resources, Android app)
• 48 modules
                                                      14
POM samples
• Super POM
•<dependencyManagement>




                          15
QA




     16
QA
• Test coverage (e.g. Cobertura)




                                   16
QA
• Test coverage (e.g. Cobertura)
• Static analysis (e.g. FindBugs)




                                    16
QA
• Test coverage (e.g. Cobertura)
• Static analysis (e.g. FindBugs)
• You just need to configure the proper plugin




                                                 16
QA
• Test coverage (e.g. Cobertura)
• Static analysis (e.g. FindBugs)
• You just need to configure the proper plugin
 –Reuse a Super POM!




                                                 16
QA
• Test coverage (e.g. Cobertura)
• Static analysis (e.g. FindBugs)
• You just need to configure the proper plugin
 –Reuse a Super POM!
• Same configuration for all kind of projects




                                                 16
QA
• Test coverage (e.g. Cobertura)
• Static analysis (e.g. FindBugs)
• You just need to configure the proper plugin
 –Reuse a Super POM!
• Same configuration for all kind of projects
• See some examples




                                                 16
Continuous Integration with Hudson




                                 17
Continuous Integration with Hudson
• CI is a well known best practice




                                     17
Continuous Integration with Hudson
• CI is a well known best practice
 –“continuously applying QA”




                                     17
Continuous Integration with Hudson
• CI is a well known best practice
 –“continuously applying QA”
• Should be automated




                                     17
Continuous Integration with Hudson
• CI is a well known best practice
 –“continuously applying QA”
• Should be automated
 –CI server (Hudson/Jenkins the most popular)




                                                17
Continuous Integration with Hudson
• CI is a well known best practice
 –“continuously applying QA”
• Should be automated
 –CI server (Hudson/Jenkins the most popular)
• See some examples




                                                17
Continuous Integration with Hudson
• CI is a well known best practice
 –“continuously applying QA”
• Should be automated
 –CI server (Hudson/Jenkins the most popular)
• See some examples




                                                17
Release




          18
Release
• Maven manages a standard release workflow




                                              18
Release
• Maven manages a standard release workflow
 –Automatically handles versioning (SNAPSHOT, ...)




                                                     18
Release
• Maven manages a standard release workflow
 –Automatically handles versioning (SNAPSHOT, ...)
 –Performs some consistency checks




                                                     18
Release
• Maven manages a standard release workflow
 –Automatically handles versioning (SNAPSHOT, ...)
 –Performs some consistency checks
 –Customizable




                                                     18
Release
• Maven manages a standard release workflow
 –Automatically handles versioning (SNAPSHOT, ...)
 –Performs some consistency checks
 –Customizable
• Distribution artifacts can be deployed to a repo




                                                     18
Release
• Maven manages a standard release workflow
 –Automatically handles versioning (SNAPSHOT, ...)
 –Performs some consistency checks
 –Customizable
• Distribution artifacts can be deployed to a repo
• Releasing can be performed by Hudson




                                                     18
Release
• Maven manages a standard release workflow
 –Automatically handles versioning (SNAPSHOT, ...)
 –Performs some consistency checks
 –Customizable
• Distribution artifacts can be deployed to a repo
• Releasing can be performed by Hudson
 –“Push a button” release




                                                     18
Advanced stuff, tricks and tweaks




                                    19
Advanced stuff, tricks and tweaks
• They say that Maven is not flexible




                                        19
Advanced stuff, tricks and tweaks
• They say that Maven is not flexible
• It’s not true




                                        19
Advanced stuff, tricks and tweaks
• They say that Maven is not flexible
• It’s not true
• It’s flexible if you work in its way




                                         19
Advanced stuff, tricks and tweaks
• They say that Maven is not flexible
• It’s not true
• It’s flexible if you work in its way
• Some examples in the following slides




                                          19
Advanced stuff, tricks and tweaks
• They say that Maven is not flexible
• It’s not true
• It’s flexible if you work in its way
• Some examples in the following slides
 –Maybe overkill




                                          19
Advanced stuff, tricks and tweaks
• They say that Maven is not flexible
• It’s not true
• It’s flexible if you work in its way
• Some examples in the following slides
 –Maybe overkill
 –Maybe tweaks




                                          19
Preprocessing AndroidManifest.xml




                                    20
Preprocessing AndroidManifest.xml
• blueBill Mobile release cycle




                                    20
Preprocessing AndroidManifest.xml
• blueBill Mobile release cycle
 –production




                                    20
Preprocessing AndroidManifest.xml
• blueBill Mobile release cycle
 –production
 –alpha: can be installed side-by-side, uses separate workarea




                                                            20
Preprocessing AndroidManifest.xml
• blueBill Mobile release cycle
 –production
 –alpha: can be installed side-by-side, uses separate workarea
 –beta: can be installed side-by-side, uses same workakea




                                                            20
Preprocessing AndroidManifest.xml
• blueBill Mobile release cycle
  –production
  –alpha: can be installed side-by-side, uses separate workarea
  –beta: can be installed side-by-side, uses same workakea
• Multiple profiles




                                                             20
Preprocessing AndroidManifest.xml
• blueBill Mobile release cycle
  –production
  –alpha: can be installed side-by-side, uses separate workarea
  –beta: can be installed side-by-side, uses same workakea
• Multiple profiles
  –Automatically set versionName from POM




                                                             20
Preprocessing AndroidManifest.xml
• blueBill Mobile release cycle
  –production
  –alpha: can be installed side-by-side, uses separate workarea
  –beta: can be installed side-by-side, uses same workakea
• Multiple profiles
  –Automatically set versionName from POM
  –Automatically set versionCode




                                                             20
Preprocessing AndroidManifest.xml
• blueBill Mobile release cycle
  –production
  –alpha: can be installed side-by-side, uses separate workarea
  –beta: can be installed side-by-side, uses same workakea
• Multiple profiles
  –Automatically set versionName from POM
  –Automatically set versionCode
  –Use different appPackage, label and icon




                                                             20
Preprocessing AndroidManifest.xml
• blueBill Mobile release cycle
  –production
  –alpha: can be installed side-by-side, uses separate workarea
  –beta: can be installed side-by-side, uses same workakea
• Multiple profiles
  –Automatically set versionName from POM
  –Automatically set versionCode
  –Use different appPackage, label and icon
• Can be done with android:manifest-update goal


                                                             20
Preprocessing AndroidManifest.xml
• blueBill Mobile release cycle
  –production
  –alpha: can be installed side-by-side, uses separate workarea
  –beta: can be installed side-by-side, uses same workakea
• Multiple profiles
  –Automatically set versionName from POM
  –Automatically set versionCode
  –Use different appPackage, label and icon
• Can be done with android:manifest-update goal
• Can be done in other ways
                                                             20
Preprocessing AndroidManifest.xml
• blueBill Mobile release cycle
  –production
  –alpha: can be installed side-by-side, uses separate workarea
  –beta: can be installed side-by-side, uses same workakea
• Multiple profiles
  –Automatically set versionName from POM
  –Automatically set versionCode
  –Use different appPackage, label and icon
• Can be done with android:manifest-update goal
• Can be done in other ways
  –e.g. the Groovy Maven plugin
                                                             20
Patching jars




                21
Patching jars
• Sometimes you might need to patch some library




                                               21
Patching jars
• Sometimes you might need to patch some library
 –Use some JSE runtime classes not available in Android




                                                     21
Patching jars
• Sometimes you might need to patch some library
 –Use some JSE runtime classes not available in Android
 –Some Swing stuff, XML stuff (for older Android versions)




                                                        21
Patching jars
• Sometimes you might need to patch some library
 –Use some JSE runtime classes not available in Android
 –Some Swing stuff, XML stuff (for older Android versions)
• maven-shade-plugin




                                                        21
Patching jars
• Sometimes you might need to patch some library
 –Use some JSE runtime classes not available in Android
 –Some Swing stuff, XML stuff (for older Android versions)
• maven-shade-plugin
 –filters: strip some classes out of a jar




                                                        21
Patching jars
• Sometimes you might need to patch some library
 –Use some JSE runtime classes not available in Android
 –Some Swing stuff, XML stuff (for older Android versions)
• maven-shade-plugin
 –filters: strip some classes out of a jar
 –relocations: change class references in the bytecode




                                                         21
Patching jars
• Sometimes you might need to patch some library
 –Use some JSE runtime classes not available in Android
 –Some Swing stuff, XML stuff (for older Android versions)
• maven-shade-plugin
 –filters: strip some classes out of a jar
 –relocations: change class references in the bytecode
• See the code example




                                                         21
Reusing R.java (pre-4.0 trick)




                                 22
Reusing R.java (pre-4.0 trick)
• R.java is automatically generated by the SDK




                                                 22
Reusing R.java (pre-4.0 trick)
• R.java is automatically generated by the SDK
 –It contains constants referring to resources




                                                 22
Reusing R.java (pre-4.0 trick)
• R.java is automatically generated by the SDK
 –It contains constants referring to resources
 –“progressive” values




                                                 22
Reusing R.java (pre-4.0 trick)
• R.java is automatically generated by the SDK
 –It contains constants referring to resources
 –“progressive” values
 –uh oh: javac inlines static final variables




                                                 22
Reusing R.java (pre-4.0 trick)
• R.java is automatically generated by the SDK
 –It contains constants referring to resources
 –“progressive” values
 –uh oh: javac inlines static final variables
 –two R.java’s from two modules are likely to collide




                                                        22
Reusing R.java (pre-4.0 trick)
• R.java is automatically generated by the SDK
 –It contains constants referring to resources
 –“progressive” values
 –uh oh: javac inlines static final variables
 –two R.java’s from two modules are likely to collide
 –changed in Android 4.0




                                                        22
Reusing R.java (pre-4.0 trick)
• R.java is automatically generated by the SDK
 –It contains constants referring to resources
 –“progressive” values
 –uh oh: javac inlines static final variables
 –two R.java’s from two modules are likely to collide
 –changed in Android 4.0
• What to do?




                                                        22
Reusing R.java (pre-4.0 trick)
• R.java is automatically generated by the SDK
 –It contains constants referring to resources
 –“progressive” values
 –uh oh: javac inlines static final variables
 –two R.java’s from two modules are likely to collide
 –changed in Android 4.0
• What to do?
• maven-rindirect-plugin



                                                        22
Reusing R.java (pre-4.0 trick)
• R.java is automatically generated by the SDK
 –It contains constants referring to resources
 –“progressive” values
 –uh oh: javac inlines static final variables
 –two R.java’s from two modules are likely to collide
 –changed in Android 4.0
• What to do?
• maven-rindirect-plugin
 –generates an “indirect” R.java which delegates


                                                        22
Reusing R.java (pre-4.0 trick)
• R.java is automatically generated by the SDK
 –It contains constants referring to resources
 –“progressive” values
 –uh oh: javac inlines static final variables
 –two R.java’s from two modules are likely to collide
 –changed in Android 4.0
• What to do?
• maven-rindirect-plugin
 –generates an “indirect” R.java which delegates
• Or a trick with the maven-replacer-plugin
                                                        22
Why and when?
    Evaluating whether Maven
     is the good choice for you
Maven is about knowledge reuse




                                 24
Maven is about knowledge reuse
• According to the Merriam-Webster:




                                      24
Maven is about knowledge reuse
• According to the Merriam-Webster:
 –“maven: one who is experienced or knowledgeable”




                                                     24
Maven is about knowledge reuse
• According to the Merriam-Webster:
 –“maven: one who is experienced or knowledgeable”
• Reuse by inheritance and composition




                                                     24
Maven is about knowledge reuse
• According to the Merriam-Webster:
 –“maven: one who is experienced or knowledgeable”
• Reuse by inheritance and composition
• It’s about putting your and others’ experience
  into your build system and reuse it




                                                     24
Maven is about knowledge reuse
• According to the Merriam-Webster:
 –“maven: one who is experienced or knowledgeable”
• Reuse by inheritance and composition
• It’s about putting your and others’ experience
  into your build system and reuse it
 –the Super POM




                                                     24
Benefits of Maven




                    25
Benefits of Maven
• Have a standard project structure for everything




                                                25
Benefits of Maven
• Have a standard project structure for everything
 –For JSE, JEE, Android, NetBeans Platform, ...




                                                  25
Benefits of Maven
• Have a standard project structure for everything
 –For JSE, JEE, Android, NetBeans Platform, ...
• Have a standard build workflow and CI




                                                  25
Benefits of Maven
• Have a standard project structure for everything
 –For JSE, JEE, Android, NetBeans Platform, ...
• Have a standard build workflow and CI
 –Test coverage, static analysis, ... (more later)




                                                     25
Benefits of Maven
• Have a standard project structure for everything
 –For JSE, JEE, Android, NetBeans Platform, ...
• Have a standard build workflow and CI
 –Test coverage, static analysis, ... (more later)
• Have a standard release workflow




                                                     25
Benefits of Maven
• Have a standard project structure for everything
 –For JSE, JEE, Android, NetBeans Platform, ...
• Have a standard build workflow and CI
 –Test coverage, static analysis, ... (more later)
• Have a standard release workflow
• Easily include libraries, manage dependencies




                                                     25
Benefits of Maven
• Have a standard project structure for everything
 –For JSE, JEE, Android, NetBeans Platform, ...
• Have a standard build workflow and CI
 –Test coverage, static analysis, ... (more later)
• Have a standard release workflow
• Easily include libraries, manage dependencies
 –Reporting!




                                                     25
Benefits of Maven
• Have a standard project structure for everything
 –For JSE, JEE, Android, NetBeans Platform, ...
• Have a standard build workflow and CI
 –Test coverage, static analysis, ... (more later)
• Have a standard release workflow
• Easily include libraries, manage dependencies
 –Reporting!
• IDE neutral



                                                     25
Benefits of Maven
• Have a standard project structure for everything
 –For JSE, JEE, Android, NetBeans Platform, ...
• Have a standard build workflow and CI
 –Test coverage, static analysis, ... (more later)
• Have a standard release workflow
• Easily include libraries, manage dependencies
 –Reporting!
• IDE neutral
• CLI just works as the IDE

                                                     25
Benefits of Maven
• Have a standard project structure for everything
 –For JSE, JEE, Android, NetBeans Platform, ...
• Have a standard build workflow and CI
 –Test coverage, static analysis, ... (more later)
• Have a standard release workflow
• Easily include libraries, manage dependencies
 –Reporting!
• IDE neutral
• CLI just works as the IDE
• Language neutral (e.g. Scala, Groovy, ...)
                                                     25
Is Maven the right tool for you?




                                   26
Is Maven the right tool for you?
• Undoubtedly Maven is more complex




                                      26
Is Maven the right tool for you?
• Undoubtedly Maven is more complex
 –in the “entropic” meaning (needed known things)




                                                    26
Is Maven the right tool for you?
• Undoubtedly Maven is more complex
 –in the “entropic” meaning (needed known things)
 –simple things are reasonably simple




                                                    26
Is Maven the right tool for you?
• Undoubtedly Maven is more complex
 –in the “entropic” meaning (needed known things)
 –simple things are reasonably simple
 –but you’ll need time to master it




                                                    26
Is Maven the right tool for you?
• Undoubtedly Maven is more complex
  –in the “entropic” meaning (needed known things)
  –simple things are reasonably simple
  –but you’ll need time to master it
• Most of people whining about Maven don’t know it well




                                                      26
Is Maven the right tool for you?
• Undoubtedly Maven is more complex
  –in the “entropic” meaning (needed known things)
  –simple things are reasonably simple
  –but you’ll need time to master it
• Most of people whining about Maven don’t know it well
  –but we’ve got different minds and you might not like it




                                                             26
Is Maven the right tool for you?
• Undoubtedly Maven is more complex
  –in the “entropic” meaning (needed known things)
  –simple things are reasonably simple
  –but you’ll need time to master it
• Most of people whining about Maven don’t know it well
  –but we’ve got different minds and you might not like it
• For single developers / very simple projects




                                                             26
Is Maven the right tool for you?
• Undoubtedly Maven is more complex
  –in the “entropic” meaning (needed known things)
  –simple things are reasonably simple
  –but you’ll need time to master it
• Most of people whining about Maven don’t know it well
  –but we’ve got different minds and you might not like it
• For single developers / very simple projects
  –might be overkill




                                                             26
Is Maven the right tool for you?
• Undoubtedly Maven is more complex
  –in the “entropic” meaning (needed known things)
  –simple things are reasonably simple
  –but you’ll need time to master it
• Most of people whining about Maven don’t know it well
  –but we’ve got different minds and you might not like it
• For single developers / very simple projects
  –might be overkill
  –but it’s a matter of reusing knowledge



                                                             26
Is Maven the right tool for you?
• Undoubtedly Maven is more complex
  –in the “entropic” meaning (needed known things)
  –simple things are reasonably simple
  –but you’ll need time to master it
• Most of people whining about Maven don’t know it well
  –but we’ve got different minds and you might not like it
• For single developers / very simple projects
  –might be overkill
  –but it’s a matter of reusing knowledge
• For companies

                                                             26
Is Maven the right tool for you?
• Undoubtedly Maven is more complex
  –in the “entropic” meaning (needed known things)
  –simple things are reasonably simple
  –but you’ll need time to master it
• Most of people whining about Maven don’t know it well
  –but we’ve got different minds and you might not like it
• For single developers / very simple projects
  –might be overkill
  –but it’s a matter of reusing knowledge
• For companies
  –it’s a must (think of modularization, CI, quality)

                                                             26
Is Maven the right tool for you?
• Undoubtedly Maven is more complex
  –in the “entropic” meaning (needed known things)
  –simple things are reasonably simple
  –but you’ll need time to master it
• Most of people whining about Maven don’t know it well
  –but we’ve got different minds and you might not like it
• For single developers / very simple projects
  –might be overkill
  –but it’s a matter of reusing knowledge
• For companies
  –it’s a must (think of modularization, CI, quality)
  –some infrastructure needed (e.g. Nexus)
                                                             26
Is Maven the right tool for you?
• Undoubtedly Maven is more complex
  –in the “entropic” meaning (needed known things)
  –simple things are reasonably simple
  –but you’ll need time to master it
• Most of people whining about Maven don’t know it well
  –but we’ve got different minds and you might not like it
• For single developers / very simple projects
  –might be overkill
  –but it’s a matter of reusing knowledge
• For companies
  –it’s a must (think of modularization, CI, quality)
  –some infrastructure needed (e.g. Nexus)
                                                             26
Resources
• http://maven.apache.org
• http://sonatype.com/Support/Books
• http://code.google.com/p/maven-android-plugin
• http://code.google.com/p/robotium
• http://simpligility.com/2011/11/apache-maven-at-andevcon-ii
• http://bluebill.tidalwave.it/mobile
• http://kenai.com/projects/nbandroid
• http://rgladwell.github.com/m2e-android/
• http://code.google.com/p/robotium/
• http://github.com/akquinet/android-rindirect
                                                           27
Question time
 ... and thanks for your attention!

                   fabrizio.giudici@tidalwave.it
     http://weblogs.java.net/blog/fabriziogiudici
                           http://fabriziogiudici.it

More Related Content

What's hot

Story of Puppet @eBay Global Classifieds Group (eCG)
Story of Puppet @eBay Global Classifieds Group (eCG)Story of Puppet @eBay Global Classifieds Group (eCG)
Story of Puppet @eBay Global Classifieds Group (eCG)Puppet
 
AtlasCamp US 2012 Keynote, Jean-Michel Lemieux
AtlasCamp US 2012 Keynote, Jean-Michel LemieuxAtlasCamp US 2012 Keynote, Jean-Michel Lemieux
AtlasCamp US 2012 Keynote, Jean-Michel LemieuxAtlassian
 
Expose Yourself! How to Leverage Plugin Extensibility to Delight your Users, ...
Expose Yourself! How to Leverage Plugin Extensibility to Delight your Users, ...Expose Yourself! How to Leverage Plugin Extensibility to Delight your Users, ...
Expose Yourself! How to Leverage Plugin Extensibility to Delight your Users, ...Atlassian
 
Developing for Remote Bamboo Agents, AtlasCamp US 2012
Developing for Remote Bamboo Agents, AtlasCamp US 2012Developing for Remote Bamboo Agents, AtlasCamp US 2012
Developing for Remote Bamboo Agents, AtlasCamp US 2012Atlassian
 
Scrumbox ece2011.pptx
Scrumbox ece2011.pptxScrumbox ece2011.pptx
Scrumbox ece2011.pptxda152
 
Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Hannes Lowette
 
20110903 candycane
20110903 candycane20110903 candycane
20110903 candycaneYusuke Ando
 
Maven 3 Overview
Maven 3  OverviewMaven 3  Overview
Maven 3 OverviewMike Ensor
 
Making Py Pi Sux Less Key
Making Py Pi Sux Less KeyMaking Py Pi Sux Less Key
Making Py Pi Sux Less KeyAndreas Jung
 
Maintaining reliability in an unreliable world
Maintaining reliability in an unreliable worldMaintaining reliability in an unreliable world
Maintaining reliability in an unreliable worldJeremy Edberg
 
Geneva Jug (30th March, 2010) - Maven
Geneva Jug (30th March, 2010) - MavenGeneva Jug (30th March, 2010) - Maven
Geneva Jug (30th March, 2010) - MavenArnaud Héritier
 
Alpes Jug (29th March, 2010) - Apache Maven
Alpes Jug (29th March, 2010) - Apache MavenAlpes Jug (29th March, 2010) - Apache Maven
Alpes Jug (29th March, 2010) - Apache MavenArnaud Héritier
 

What's hot (12)

Story of Puppet @eBay Global Classifieds Group (eCG)
Story of Puppet @eBay Global Classifieds Group (eCG)Story of Puppet @eBay Global Classifieds Group (eCG)
Story of Puppet @eBay Global Classifieds Group (eCG)
 
AtlasCamp US 2012 Keynote, Jean-Michel Lemieux
AtlasCamp US 2012 Keynote, Jean-Michel LemieuxAtlasCamp US 2012 Keynote, Jean-Michel Lemieux
AtlasCamp US 2012 Keynote, Jean-Michel Lemieux
 
Expose Yourself! How to Leverage Plugin Extensibility to Delight your Users, ...
Expose Yourself! How to Leverage Plugin Extensibility to Delight your Users, ...Expose Yourself! How to Leverage Plugin Extensibility to Delight your Users, ...
Expose Yourself! How to Leverage Plugin Extensibility to Delight your Users, ...
 
Developing for Remote Bamboo Agents, AtlasCamp US 2012
Developing for Remote Bamboo Agents, AtlasCamp US 2012Developing for Remote Bamboo Agents, AtlasCamp US 2012
Developing for Remote Bamboo Agents, AtlasCamp US 2012
 
Scrumbox ece2011.pptx
Scrumbox ece2011.pptxScrumbox ece2011.pptx
Scrumbox ece2011.pptx
 
Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®
 
20110903 candycane
20110903 candycane20110903 candycane
20110903 candycane
 
Maven 3 Overview
Maven 3  OverviewMaven 3  Overview
Maven 3 Overview
 
Making Py Pi Sux Less Key
Making Py Pi Sux Less KeyMaking Py Pi Sux Less Key
Making Py Pi Sux Less Key
 
Maintaining reliability in an unreliable world
Maintaining reliability in an unreliable worldMaintaining reliability in an unreliable world
Maintaining reliability in an unreliable world
 
Geneva Jug (30th March, 2010) - Maven
Geneva Jug (30th March, 2010) - MavenGeneva Jug (30th March, 2010) - Maven
Geneva Jug (30th March, 2010) - Maven
 
Alpes Jug (29th March, 2010) - Apache Maven
Alpes Jug (29th March, 2010) - Apache MavenAlpes Jug (29th March, 2010) - Apache Maven
Alpes Jug (29th March, 2010) - Apache Maven
 

Viewers also liked

Captain Agile and the Providers of Value
Captain Agile and the Providers of ValueCaptain Agile and the Providers of Value
Captain Agile and the Providers of ValueSchalk Cronjé
 
Injection de dépendances
Injection de dépendancesInjection de dépendances
Injection de dépendancesMathurin Body
 
20091112 - Mars Jug - Apache Maven
20091112 - Mars Jug - Apache Maven20091112 - Mars Jug - Apache Maven
20091112 - Mars Jug - Apache MavenArnaud Héritier
 
Veni, Vide, Built: Android Gradle Plugin
Veni, Vide, Built: Android Gradle PluginVeni, Vide, Built: Android Gradle Plugin
Veni, Vide, Built: Android Gradle PluginLeonardo YongUk Kim
 
Gradle enabled android project
Gradle enabled android projectGradle enabled android project
Gradle enabled android projectShaka Huang
 
不只自動化而且更敏捷的Android開發工具 gradle mopcon
不只自動化而且更敏捷的Android開發工具 gradle mopcon不只自動化而且更敏捷的Android開發工具 gradle mopcon
不只自動化而且更敏捷的Android開發工具 gradle mopconsam chiu
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Carlos Sanchez
 
Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012Rajmahendra Hegde
 
Gradle - the Enterprise Automation Tool
Gradle  - the Enterprise Automation ToolGradle  - the Enterprise Automation Tool
Gradle - the Enterprise Automation ToolIzzet Mustafaiev
 
Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010Tomek Kaczanowski
 
Mastering Maven 2.0 In 1 Hour V1.3
Mastering Maven 2.0 In 1 Hour V1.3Mastering Maven 2.0 In 1 Hour V1.3
Mastering Maven 2.0 In 1 Hour V1.3Matthew McCullough
 
Drupal Continuous Integration with Jenkins - The Basics
Drupal Continuous Integration with Jenkins - The BasicsDrupal Continuous Integration with Jenkins - The Basics
Drupal Continuous Integration with Jenkins - The BasicsJohn Smith
 
Maven Application Lifecycle Management for Alfresco
Maven Application Lifecycle Management for AlfrescoMaven Application Lifecycle Management for Alfresco
Maven Application Lifecycle Management for Alfrescoguest67a9ba
 
An Introduction to Gradle for Java Developers
An Introduction to Gradle for Java DevelopersAn Introduction to Gradle for Java Developers
An Introduction to Gradle for Java DevelopersKostas Saidis
 
An introduction to Maven
An introduction to MavenAn introduction to Maven
An introduction to MavenJoao Pereira
 

Viewers also liked (20)

Captain Agile and the Providers of Value
Captain Agile and the Providers of ValueCaptain Agile and the Providers of Value
Captain Agile and the Providers of Value
 
Injection de dépendances
Injection de dépendancesInjection de dépendances
Injection de dépendances
 
20091112 - Mars Jug - Apache Maven
20091112 - Mars Jug - Apache Maven20091112 - Mars Jug - Apache Maven
20091112 - Mars Jug - Apache Maven
 
Maven 3.0 at Øredev
Maven 3.0 at ØredevMaven 3.0 at Øredev
Maven 3.0 at Øredev
 
Veni, Vide, Built: Android Gradle Plugin
Veni, Vide, Built: Android Gradle PluginVeni, Vide, Built: Android Gradle Plugin
Veni, Vide, Built: Android Gradle Plugin
 
Gradle enabled android project
Gradle enabled android projectGradle enabled android project
Gradle enabled android project
 
不只自動化而且更敏捷的Android開發工具 gradle mopcon
不只自動化而且更敏捷的Android開發工具 gradle mopcon不只自動化而且更敏捷的Android開發工具 gradle mopcon
不只自動化而且更敏捷的Android開發工具 gradle mopcon
 
Gradle
GradleGradle
Gradle
 
Gradle in 45min
Gradle in 45minGradle in 45min
Gradle in 45min
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
 
Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012
 
Gradle - the Enterprise Automation Tool
Gradle  - the Enterprise Automation ToolGradle  - the Enterprise Automation Tool
Gradle - the Enterprise Automation Tool
 
Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010
 
Mastering Maven 2.0 In 1 Hour V1.3
Mastering Maven 2.0 In 1 Hour V1.3Mastering Maven 2.0 In 1 Hour V1.3
Mastering Maven 2.0 In 1 Hour V1.3
 
Drupal Continuous Integration with Jenkins - The Basics
Drupal Continuous Integration with Jenkins - The BasicsDrupal Continuous Integration with Jenkins - The Basics
Drupal Continuous Integration with Jenkins - The Basics
 
Gradle by Example
Gradle by ExampleGradle by Example
Gradle by Example
 
Maven Application Lifecycle Management for Alfresco
Maven Application Lifecycle Management for AlfrescoMaven Application Lifecycle Management for Alfresco
Maven Application Lifecycle Management for Alfresco
 
Gradle Introduction
Gradle IntroductionGradle Introduction
Gradle Introduction
 
An Introduction to Gradle for Java Developers
An Introduction to Gradle for Java DevelopersAn Introduction to Gradle for Java Developers
An Introduction to Gradle for Java Developers
 
An introduction to Maven
An introduction to MavenAn introduction to Maven
An introduction to Maven
 

Similar to Building Android apps with Maven

Java is evolving rapidly: Maven helps you staying on track
Java is evolving rapidly:  Maven helps you staying on trackJava is evolving rapidly:  Maven helps you staying on track
Java is evolving rapidly: Maven helps you staying on trackArnaud Héritier
 
Apache Maven - eXo TN presentation
Apache Maven - eXo TN presentationApache Maven - eXo TN presentation
Apache Maven - eXo TN presentationArnaud Héritier
 
Java build tools
Java build toolsJava build tools
Java build toolsSujit Kumar
 
Practical maven-slides 2
Practical maven-slides 2Practical maven-slides 2
Practical maven-slides 2Will Iverson
 
S/W Design and Modularity using Maven
S/W Design and Modularity using MavenS/W Design and Modularity using Maven
S/W Design and Modularity using MavenScheidt & Bachmann
 
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
 
Continuous Integration with Maven for Android apps
Continuous Integration with Maven for Android appsContinuous Integration with Maven for Android apps
Continuous Integration with Maven for Android appsHugo Josefson
 
software technology benchmarking
software  technology benchmarkingsoftware  technology benchmarking
software technology benchmarkingMallikarjuna G D
 
ToursJUG-Maven 3.x, will it lives up to its promises
ToursJUG-Maven 3.x, will it lives up to its promisesToursJUG-Maven 3.x, will it lives up to its promises
ToursJUG-Maven 3.x, will it lives up to its promisesArnaud Héritier
 
Artifacts management with DevOps
Artifacts management with DevOpsArtifacts management with DevOps
Artifacts management with DevOpsChen-Tien Tsai
 
BP-10 Keeping Your Sanity – Rapid Development & Deployment Tools
BP-10 Keeping Your Sanity – Rapid Development & Deployment ToolsBP-10 Keeping Your Sanity – Rapid Development & Deployment Tools
BP-10 Keeping Your Sanity – Rapid Development & Deployment ToolsAlfresco Software
 
Maven: from Scratch to Production (.pdf)
Maven: from Scratch to Production (.pdf)Maven: from Scratch to Production (.pdf)
Maven: from Scratch to Production (.pdf)Johan Mynhardt
 
Ci jenkins maven svn
Ci jenkins maven svnCi jenkins maven svn
Ci jenkins maven svnAnkur Goyal
 

Similar to Building Android apps with Maven (20)

4 maven junit
4 maven junit4 maven junit
4 maven junit
 
Java is evolving rapidly: Maven helps you staying on track
Java is evolving rapidly:  Maven helps you staying on trackJava is evolving rapidly:  Maven helps you staying on track
Java is evolving rapidly: Maven helps you staying on track
 
Build tool
Build toolBuild tool
Build tool
 
Apache Maven - eXo TN presentation
Apache Maven - eXo TN presentationApache Maven - eXo TN presentation
Apache Maven - eXo TN presentation
 
Java build tools
Java build toolsJava build tools
Java build tools
 
Intro to Maven.ppt
Intro to Maven.pptIntro to Maven.ppt
Intro to Maven.ppt
 
Practical maven-slides 2
Practical maven-slides 2Practical maven-slides 2
Practical maven-slides 2
 
S/W Design and Modularity using Maven
S/W Design and Modularity using MavenS/W Design and Modularity using Maven
S/W Design and Modularity using Maven
 
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
 
Continuous Integration with Maven for Android apps
Continuous Integration with Maven for Android appsContinuous Integration with Maven for Android apps
Continuous Integration with Maven for Android apps
 
software technology benchmarking
software  technology benchmarkingsoftware  technology benchmarking
software technology benchmarking
 
Apache Maven In 10 Slides
Apache Maven In 10 SlidesApache Maven In 10 Slides
Apache Maven In 10 Slides
 
Maven
MavenMaven
Maven
 
ToursJUG-Maven 3.x, will it lives up to its promises
ToursJUG-Maven 3.x, will it lives up to its promisesToursJUG-Maven 3.x, will it lives up to its promises
ToursJUG-Maven 3.x, will it lives up to its promises
 
Artifacts management with DevOps
Artifacts management with DevOpsArtifacts management with DevOps
Artifacts management with DevOps
 
Maven
MavenMaven
Maven
 
BP-10 Keeping Your Sanity – Rapid Development & Deployment Tools
BP-10 Keeping Your Sanity – Rapid Development & Deployment ToolsBP-10 Keeping Your Sanity – Rapid Development & Deployment Tools
BP-10 Keeping Your Sanity – Rapid Development & Deployment Tools
 
Maven: from Scratch to Production (.pdf)
Maven: from Scratch to Production (.pdf)Maven: from Scratch to Production (.pdf)
Maven: from Scratch to Production (.pdf)
 
Mavennotes.pdf
Mavennotes.pdfMavennotes.pdf
Mavennotes.pdf
 
Ci jenkins maven svn
Ci jenkins maven svnCi jenkins maven svn
Ci jenkins maven svn
 

More from Fabrizio Giudici

DCI - Data, Context and Interaction @ Jug Lugano May 2011
DCI - Data, Context and Interaction @ Jug Lugano May 2011 DCI - Data, Context and Interaction @ Jug Lugano May 2011
DCI - Data, Context and Interaction @ Jug Lugano May 2011 Fabrizio Giudici
 
DCI - Data, Context and Interaction @ Jug Genova April 2011
DCI - Data, Context and Interaction @ Jug Genova April 2011DCI - Data, Context and Interaction @ Jug Genova April 2011
DCI - Data, Context and Interaction @ Jug Genova April 2011Fabrizio Giudici
 
NOSQL also means RDF stores: an Android case study
NOSQL also means RDF stores: an Android case studyNOSQL also means RDF stores: an Android case study
NOSQL also means RDF stores: an Android case studyFabrizio Giudici
 
Tools for an effective software factory
Tools for an effective software factoryTools for an effective software factory
Tools for an effective software factoryFabrizio Giudici
 
Parallel Computing Scenarios and the new challenges for the Software Architect
Parallel Computing Scenarios  and the new challenges for the Software ArchitectParallel Computing Scenarios  and the new challenges for the Software Architect
Parallel Computing Scenarios and the new challenges for the Software ArchitectFabrizio Giudici
 
blueMarine a desktop app for the open source photographic workflow
blueMarine  a desktop app for the open source photographic workflowblueMarine  a desktop app for the open source photographic workflow
blueMarine a desktop app for the open source photographic workflowFabrizio Giudici
 
blueMarine photographic workflow with Java
blueMarine photographic workflow with JavablueMarine photographic workflow with Java
blueMarine photographic workflow with JavaFabrizio Giudici
 
blueMarine Sailing with NetBeans Platform
blueMarine Sailing with NetBeans PlatformblueMarine Sailing with NetBeans Platform
blueMarine Sailing with NetBeans PlatformFabrizio Giudici
 
NASA World Wind for Java API Overview
NASA World Wind for Java  API OverviewNASA World Wind for Java  API Overview
NASA World Wind for Java API OverviewFabrizio Giudici
 
Rich Internet Applications con JavaFX e NetBeans
Rich Internet Applications  con JavaFX e NetBeans Rich Internet Applications  con JavaFX e NetBeans
Rich Internet Applications con JavaFX e NetBeans Fabrizio Giudici
 
Web Development with Apache Struts 2
Web Development with  Apache Struts 2Web Development with  Apache Struts 2
Web Development with Apache Struts 2Fabrizio Giudici
 
blueMarine Or Why You Should Really Ship Swing Applications
blueMarine  Or Why You Should Really Ship Swing  Applications blueMarine  Or Why You Should Really Ship Swing  Applications
blueMarine Or Why You Should Really Ship Swing Applications Fabrizio Giudici
 
Designing a JavaFX Mobile application
Designing a JavaFX Mobile applicationDesigning a JavaFX Mobile application
Designing a JavaFX Mobile applicationFabrizio Giudici
 

More from Fabrizio Giudici (16)

DCI - Data, Context and Interaction @ Jug Lugano May 2011
DCI - Data, Context and Interaction @ Jug Lugano May 2011 DCI - Data, Context and Interaction @ Jug Lugano May 2011
DCI - Data, Context and Interaction @ Jug Lugano May 2011
 
DCI - Data, Context and Interaction @ Jug Genova April 2011
DCI - Data, Context and Interaction @ Jug Genova April 2011DCI - Data, Context and Interaction @ Jug Genova April 2011
DCI - Data, Context and Interaction @ Jug Genova April 2011
 
NOSQL also means RDF stores: an Android case study
NOSQL also means RDF stores: an Android case studyNOSQL also means RDF stores: an Android case study
NOSQL also means RDF stores: an Android case study
 
Netbeans+platform+maven
Netbeans+platform+mavenNetbeans+platform+maven
Netbeans+platform+maven
 
Tools for an effective software factory
Tools for an effective software factoryTools for an effective software factory
Tools for an effective software factory
 
Parallel Computing Scenarios and the new challenges for the Software Architect
Parallel Computing Scenarios  and the new challenges for the Software ArchitectParallel Computing Scenarios  and the new challenges for the Software Architect
Parallel Computing Scenarios and the new challenges for the Software Architect
 
blueMarine a desktop app for the open source photographic workflow
blueMarine  a desktop app for the open source photographic workflowblueMarine  a desktop app for the open source photographic workflow
blueMarine a desktop app for the open source photographic workflow
 
blueMarine photographic workflow with Java
blueMarine photographic workflow with JavablueMarine photographic workflow with Java
blueMarine photographic workflow with Java
 
blueMarine Sailing with NetBeans Platform
blueMarine Sailing with NetBeans PlatformblueMarine Sailing with NetBeans Platform
blueMarine Sailing with NetBeans Platform
 
NASA World Wind for Java API Overview
NASA World Wind for Java  API OverviewNASA World Wind for Java  API Overview
NASA World Wind for Java API Overview
 
Rich Internet Applications con JavaFX e NetBeans
Rich Internet Applications  con JavaFX e NetBeans Rich Internet Applications  con JavaFX e NetBeans
Rich Internet Applications con JavaFX e NetBeans
 
The VRC Project
The VRC ProjectThe VRC Project
The VRC Project
 
Web Development with Apache Struts 2
Web Development with  Apache Struts 2Web Development with  Apache Struts 2
Web Development with Apache Struts 2
 
blueMarine Or Why You Should Really Ship Swing Applications
blueMarine  Or Why You Should Really Ship Swing  Applications blueMarine  Or Why You Should Really Ship Swing  Applications
blueMarine Or Why You Should Really Ship Swing Applications
 
Designing a JavaFX Mobile application
Designing a JavaFX Mobile applicationDesigning a JavaFX Mobile application
Designing a JavaFX Mobile application
 
Mercurial
MercurialMercurial
Mercurial
 

Recently uploaded

Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
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
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
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
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 

Recently uploaded (20)

Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
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
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
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
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
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.
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 

Building Android apps with Maven

  • 1. Building Android apps with Maven Fabrizio Giudici Senior Java Architect Tidalwave, NetBeans Dream Team
  • 2. Agenda 2
  • 4. Agenda • Introducing Maven • The Android Plugin for Maven 2
  • 5. Agenda • Introducing Maven • The Android Plugin for Maven • A real world project 2
  • 6. Agenda • Introducing Maven • The Android Plugin for Maven • A real world project 2
  • 7. Agenda • Introducing Maven • The Android Plugin for Maven • A real world project 2
  • 8. Agenda • Introducing Maven • The Android Plugin for Maven • A real world project 2
  • 9. Agenda • Introducing Maven • The Android Plugin for Maven • A real world project • Maven: why and when? 2
  • 10. Agenda • Introducing Maven • The Android Plugin for Maven • A real world project • Maven: why and when? • Question time 2
  • 11. Agenda • Introducing Maven • The Android Plugin for Maven • A real world project • Maven: why and when? • Question time • Thanks to Manfred Moser (Simpligility) for providing some preso stuff 2
  • 13. About Fabrizio • Senior Architect, Mentor, Technical Writer –Working with Java (all the editions, plus exotic stuff) since 1996 –Frequent speaker at J1, Devoxx, Jazoon, JUGs –Blogger at Java.Net, Most Valuable Blogger at DZone • Member of the NetBeans Dream Team 3
  • 14. About Fabrizio • Senior Architect, Mentor, Technical Writer –Working with Java (all the editions, plus exotic stuff) since 1996 –Frequent speaker at J1, Devoxx, Jazoon, JUGs –Blogger at Java.Net, Most Valuable Blogger at DZone • Member of the NetBeans Dream Team • Co-leader of JUG Milano 3
  • 15. About Fabrizio • Senior Architect, Mentor, Technical Writer –Working with Java (all the editions, plus exotic stuff) since 1996 –Frequent speaker at J1, Devoxx, Jazoon, JUGs –Blogger at Java.Net, Most Valuable Blogger at DZone • Member of the NetBeans Dream Team • Co-leader of JUG Milano • In the past years shifting from “mere” design and architecture... 3
  • 16. About Fabrizio • Senior Architect, Mentor, Technical Writer –Working with Java (all the editions, plus exotic stuff) since 1996 –Frequent speaker at J1, Devoxx, Jazoon, JUGs –Blogger at Java.Net, Most Valuable Blogger at DZone • Member of the NetBeans Dream Team • Co-leader of JUG Milano • In the past years shifting from “mere” design and architecture... • ... to method & software factory optimization 3
  • 17. Introducing Maven Maven in four slides!
  • 19. Maven vs Ant • Maven is truly like cats 5
  • 20. Maven vs Ant • Maven is truly like cats –“Cats, either you love them or hate them” 5
  • 21. Maven vs Ant • Maven is truly like cats –“Cats, either you love them or hate them” 5
  • 22. Maven vs Ant • Maven is truly like cats –“Cats, either you love them or hate them” 5
  • 23. Maven vs Ant • Maven is truly like cats –“Cats, either you love them or hate them” 5
  • 24. Maven vs Ant • Maven is truly like cats –“Cats, either you love them or hate them” • Ant: a scripting interpreter, build-oriented DSL 5
  • 25. Maven vs Ant • Maven is truly like cats –“Cats, either you love them or hate them” procedural • Ant: a scripting interpreter, build-oriented DSL 5
  • 26. Maven vs Ant • Maven is truly like cats –“Cats, either you love them or hate them” procedural • Ant: a scripting interpreter, build-oriented DSL • Maven: a standard build workflow executor 5
  • 27. Maven vs Ant • Maven is truly like cats –“Cats, either you love them or hate them” procedural • Ant: a scripting interpreter, build-oriented DSL • Maven: a standard build workflow executor declarative 5
  • 28. Maven vs Ant • Maven is truly like cats –“Cats, either you love them or hate them” procedural • Ant: a scripting interpreter, build-oriented DSL • Maven: a standard build workflow executor declarative • POM: Project Object Model 5
  • 29. Maven vs Ant • Maven is truly like cats –“Cats, either you love them or hate them” procedural • Ant: a scripting interpreter, build-oriented DSL • Maven: a standard build workflow executor declarative • POM: Project Object Model –Project structure, language, packaging 5
  • 30. Maven vs Ant • Maven is truly like cats –“Cats, either you love them or hate them” procedural • Ant: a scripting interpreter, build-oriented DSL • Maven: a standard build workflow executor declarative • POM: Project Object Model –Project structure, language, packaging –Dependencies 5
  • 31. Maven vs Ant • Maven is truly like cats –“Cats, either you love them or hate them” procedural • Ant: a scripting interpreter, build-oriented DSL • Maven: a standard build workflow executor declarative • POM: Project Object Model –Project structure, language, packaging –Dependencies –Other metadata (license, developers, mailing list, etc...) 5
  • 32. Maven vs Ant • Maven is truly like cats –“Cats, either you love them or hate them” procedural • Ant: a scripting interpreter, build-oriented DSL • Maven: a standard build workflow executor declarative • POM: Project Object Model –Project structure, language, packaging –Dependencies –Other metadata (license, developers, mailing list, etc...) • Plugin oriented 5
  • 33. Maven vs Ant • Maven is truly like cats –“Cats, either you love them or hate them” procedural • Ant: a scripting interpreter, build-oriented DSL • Maven: a standard build workflow executor declarative • POM: Project Object Model –Project structure, language, packaging –Dependencies –Other metadata (license, developers, mailing list, etc...) • Plugin oriented • FLOSS (Apache License v2.0) 5
  • 35. Phases, plugins, goals • A lifecycle is a sequence of phases validate The compile test “defa package ult” l integration-test verify ifecy install c le deploy 6
  • 36. Phases, plugins, goals • A lifecycle is a sequence of phases • Every plugin can execute goals compiler validate plugin surefire The compile compile plugin test “defa package test deploy ult” l integration-test verify plugin ifecy install deploy c le deploy 6
  • 37. Phases, plugins, goals • A lifecycle is a sequence of phases • Every plugin can execute goals mvn compiler:compile • Goals can be executed manually... compiler validate plugin surefire The compile compile plugin test “defa package test deploy ult” l integration-test verify plugin ifecy install deploy c le deploy 6
  • 38. Phases, plugins, goals • A lifecycle is a sequence of phases • Every plugin can execute goals mvn compiler:compile • Goals can be executed manually... • ... or attached to phases compiler validate plugin surefire The compile compile plugin test “defa package test deploy ult” l integration-test verify plugin ifecy install deploy c le deploy 6
  • 39. Phases, plugins, goals • A lifecycle is a sequence of phases • Every plugin can execute goals mvn compiler:compile • Goals can be executed manually... • ... or attached to phases mvn install compiler validate plugin surefire The compile compile plugin test “defa package test deploy ult” l integration-test verify plugin ifecy install deploy c le deploy 6
  • 41. Artifacts and repositories • A project is usually composed by many modules 7
  • 42. Artifacts and repositories • A project is usually composed by many modules • Each module 7
  • 43. Artifacts and repositories • A project is usually composed by many modules • Each module –possibly depends on other modules’ artifacts 7
  • 44. Artifacts and repositories • A project is usually composed by many modules • Each module –possibly depends on other modules’ artifacts –produces its own artifact (maybe made of multiple files) 7
  • 45. Artifacts and repositories • A project is usually composed by many modules • Each module –possibly depends on other modules’ artifacts –produces its own artifact (maybe made of multiple files) • Each artifact 7
  • 46. Artifacts and repositories • A project is usually composed by many modules • Each module –possibly depends on other modules’ artifacts –produces its own artifact (maybe made of multiple files) • Each artifact –has got unique coordinates 7
  • 47. Artifacts and repositories • A project is usually composed by many modules • Each module –possibly depends on other modules’ artifacts –produces its own artifact (maybe made of multiple files) • Each artifact –has got unique coordinates • groupId, artifactId, version, packaging, classifier 7
  • 48. Artifacts and repositories • A project is usually composed by many modules • Each module –possibly depends on other modules’ artifacts –produces its own artifact (maybe made of multiple files) • Each artifact –has got unique coordinates • groupId, artifactId, version, packaging, classifier –can be retrieved from a local/remote repository 7
  • 49. Artifacts and repositories • A project is usually composed by many modules • Each module –possibly depends on other modules’ artifacts –produces its own artifact (maybe made of multiple files) • Each artifact –has got unique coordinates • groupId, artifactId, version, packaging, classifier –can be retrieved from a local/remote repository –can be deployed to a local/remote repository 7
  • 50. Artifacts and repositories • A project is usually composed by many modules • Each module –possibly depends on other modules’ artifacts –produces its own artifact (maybe made of multiple files) • Each artifact mvn install mvn deploy –has got unique coordinates • groupId, artifactId, version, packaging, classifier –can be retrieved from a local/remote repository –can be deployed to a local/remote repository 7
  • 51. Artifacts and repositories • A project is usually composed by many modules • Each module –possibly depends on other modules’ artifacts –produces its own artifact (maybe made of multiple files) • Each artifact mvn install mvn deploy –has got unique coordinates • groupId, artifactId, version, packaging, classifier –can be retrieved from a local/remote repository –can be deployed to a local/remote repository • Local repo is at $HOME/.m2/repository 7
  • 52. Artifacts and repositories • A project is usually composed by many modules • Each module –possibly depends on other modules’ artifacts –produces its own artifact (maybe made of multiple files) • Each artifact mvn install mvn deploy –has got unique coordinates • groupId, artifactId, version, packaging, classifier –can be retrieved from a local/remote repository –can be deployed to a local/remote repository • Local repo is at $HOME/.m2/repository • Remote repo is the internet, or your own, or both 7
  • 53. Artifacts and repositories • A project is usually composed by many modules • Each module –possibly depends on other modules’ artifacts –produces its own artifact (maybe made of multiple files) • Each artifact mvn install mvn deploy –has got unique coordinates • groupId, artifactId, version, packaging, classifier –can be retrieved from a local/remote repository –can be deployed to a local/remote repository • Local repo is at $HOME/.m2/repository • Remote repo is the internet, or your own, or both 7
  • 55. Project structure • Master POM Master POM 8
  • 56. Project structure • Master POM • Includes Module POMs includes Master POM Module 1 POM Modules Module 2 POM POM Module 3 POM 8
  • 57. Project structure • Master POM • Includes Module POMs includes inherits • POMs can inherit Master POM Module 1 POM Modules Module 2 POM POM Module 3 POM 8
  • 58. Project structure • Master POM • Includes Module POMs includes inherits • POMs can inherit –DRY Master POM Module 1 POM Modules Module 2 POM POM Module 3 POM 8
  • 59. Project structure • Master POM Super • Includes Module POMs POM includes inherits • POMs can inherit –DRY Master • A Super POM is really POM Module 1 POM valuable Modules Module 2 POM POM Module 3 POM 8
  • 63. The maven-android-plugin • maven-android-plugin –Also android-maven-plugin (3.0) 10
  • 64. The maven-android-plugin • maven-android-plugin –Also android-maven-plugin (3.0) –Made by Jayway (jayway.se), FLOSS 10
  • 65. The maven-android-plugin • maven-android-plugin –Also android-maven-plugin (3.0) –Made by Jayway (jayway.se), FLOSS • Makes it possible to call Android SDK tools 10
  • 66. The maven-android-plugin • maven-android-plugin –Also android-maven-plugin (3.0) –Made by Jayway (jayway.se), FLOSS • Makes it possible to call Android SDK tools • Goals: 10
  • 67. The maven-android-plugin • maven-android-plugin –Also android-maven-plugin (3.0) –Made by Jayway (jayway.se), FLOSS • Makes it possible to call Android SDK tools • Goals: –generate-sources, apk, apklib, dex, zipalign, unpack 10
  • 68. The maven-android-plugin • maven-android-plugin –Also android-maven-plugin (3.0) –Made by Jayway (jayway.se), FLOSS • Makes it possible to call Android SDK tools • Goals: –generate-sources, apk, apklib, dex, zipalign, unpack –deploy, deploy-dependencies, redeploy, undeploy 10
  • 69. The maven-android-plugin • maven-android-plugin –Also android-maven-plugin (3.0) –Made by Jayway (jayway.se), FLOSS • Makes it possible to call Android SDK tools • Goals: –generate-sources, apk, apklib, dex, zipalign, unpack –deploy, deploy-dependencies, redeploy, undeploy –emulator-start, emulator-stop, run 10
  • 70. The maven-android-plugin • maven-android-plugin –Also android-maven-plugin (3.0) –Made by Jayway (jayway.se), FLOSS • Makes it possible to call Android SDK tools • Goals: –generate-sources, apk, apklib, dex, zipalign, unpack –deploy, deploy-dependencies, redeploy, undeploy –emulator-start, emulator-stop, run –push, pull 10
  • 71. The maven-android-plugin • maven-android-plugin –Also android-maven-plugin (3.0) –Made by Jayway (jayway.se), FLOSS • Makes it possible to call Android SDK tools • Goals: –generate-sources, apk, apklib, dex, zipalign, unpack –deploy, deploy-dependencies, redeploy, undeploy –emulator-start, emulator-stop, run –push, pull • Supports native development (NDK) 10
  • 72. The maven-android-plugin • maven-android-plugin –Also android-maven-plugin (3.0) –Made by Jayway (jayway.se), FLOSS • Makes it possible to call Android SDK tools • Goals: –generate-sources, apk, apklib, dex, zipalign, unpack –deploy, deploy-dependencies, redeploy, undeploy –emulator-start, emulator-stop, run –push, pull • Supports native development (NDK) –Not covered in this talk 10
  • 74. The MorseFlash demo app • A very simple application, perfect starter 11
  • 75. The MorseFlash demo app • A very simple application, perfect starter –Generates Morse signals out of a word 11
  • 76. The MorseFlash demo app • A very simple application, perfect starter –Generates Morse signals out of a word –Note that the POMs are naive (more later) 11
  • 77. The MorseFlash demo app • A very simple application, perfect starter –Generates Morse signals out of a word –Note that the POMs are naive (more later) • Made of four POMs 11
  • 78. The MorseFlash demo app • A very simple application, perfect starter –Generates Morse signals out of a word –Note that the POMs are naive (more later) • Made of four POMs –The Master POM 11
  • 79. The MorseFlash demo app • A very simple application, perfect starter –Generates Morse signals out of a word –Note that the POMs are naive (more later) • Made of four POMs –The Master POM –The Library (pure JSE code for Morse coding) 11
  • 80. The MorseFlash demo app • A very simple application, perfect starter –Generates Morse signals out of a word –Note that the POMs are naive (more later) • Made of four POMs –The Master POM –The Library (pure JSE code for Morse coding) –The application 11
  • 81. The MorseFlash demo app • A very simple application, perfect starter –Generates Morse signals out of a word –Note that the POMs are naive (more later) • Made of four POMs –The Master POM –The Library (pure JSE code for Morse coding) –The application –Integration tests 11
  • 82. The MorseFlash demo app • A very simple application, perfect starter –Generates Morse signals out of a word –Note that the POMs are naive (more later) • Made of four POMs –The Master POM –The Library (pure JSE code for Morse coding) –The application –Integration tests • Includes support for signing and obfuscating 11
  • 83. The MorseFlash demo app • A very simple application, perfect starter –Generates Morse signals out of a word –Note that the POMs are naive (more later) • Made of four POMs –The Master POM –The Library (pure JSE code for Morse coding) –The application –Integration tests • Includes support for signing and obfuscating • Two profiles, “standard” and “release” 11
  • 84. Android Libraries • Support for Android apklib –zipped file with both code and resources (including R.java) –can be used for reusing code • The Android Maven plugin supports it –even though sources are not layout in the standard way • Personally I don’t like it • More about reusing libraries later 12
  • 85. A real world project blueBill Mobile
  • 87. blueBill Mobile • For bird(watch)ers 14
  • 88. blueBill Mobile • For bird(watch)ers –Record geotagged observations on the field 14
  • 89. blueBill Mobile • For bird(watch)ers –Record geotagged observations on the field –Browse fact sheets and multimedia resources 14
  • 90. blueBill Mobile • For bird(watch)ers –Record geotagged observations on the field –Browse fact sheets and multimedia resources • Sophisticated data structure 14
  • 91. blueBill Mobile • For bird(watch)ers –Record geotagged observations on the field –Browse fact sheets and multimedia resources • Sophisticated data structure –RDF, semantic web 14
  • 92. blueBill Mobile • For bird(watch)ers –Record geotagged observations on the field –Browse fact sheets and multimedia resources • Sophisticated data structure –RDF, semantic web • Reuses code from JSE and JEE projects 14
  • 93. blueBill Mobile • For bird(watch)ers –Record geotagged observations on the field –Browse fact sheets and multimedia resources • Sophisticated data structure –RDF, semantic web • Reuses code from JSE and JEE projects • Uses some libraries from the NetBeans Platform 14
  • 94. blueBill Mobile • For bird(watch)ers –Record geotagged observations on the field –Browse fact sheets and multimedia resources • Sophisticated data structure –RDF, semantic web • Reuses code from JSE and JEE projects • Uses some libraries from the NetBeans Platform –for implementing DCI (Data, Context, Interaction) 14
  • 95. blueBill Mobile • For bird(watch)ers –Record geotagged observations on the field –Browse fact sheets and multimedia resources • Sophisticated data structure –RDF, semantic web • Reuses code from JSE and JEE projects • Uses some libraries from the NetBeans Platform –for implementing DCI (Data, Context, Interaction) • 3 projects (core, resources, Android app) 14
  • 96. blueBill Mobile • For bird(watch)ers –Record geotagged observations on the field –Browse fact sheets and multimedia resources • Sophisticated data structure –RDF, semantic web • Reuses code from JSE and JEE projects • Uses some libraries from the NetBeans Platform –for implementing DCI (Data, Context, Interaction) • 3 projects (core, resources, Android app) • 48 modules 14
  • 97. POM samples • Super POM •<dependencyManagement> 15
  • 98. QA 16
  • 99. QA • Test coverage (e.g. Cobertura) 16
  • 100. QA • Test coverage (e.g. Cobertura) • Static analysis (e.g. FindBugs) 16
  • 101. QA • Test coverage (e.g. Cobertura) • Static analysis (e.g. FindBugs) • You just need to configure the proper plugin 16
  • 102. QA • Test coverage (e.g. Cobertura) • Static analysis (e.g. FindBugs) • You just need to configure the proper plugin –Reuse a Super POM! 16
  • 103. QA • Test coverage (e.g. Cobertura) • Static analysis (e.g. FindBugs) • You just need to configure the proper plugin –Reuse a Super POM! • Same configuration for all kind of projects 16
  • 104. QA • Test coverage (e.g. Cobertura) • Static analysis (e.g. FindBugs) • You just need to configure the proper plugin –Reuse a Super POM! • Same configuration for all kind of projects • See some examples 16
  • 106. Continuous Integration with Hudson • CI is a well known best practice 17
  • 107. Continuous Integration with Hudson • CI is a well known best practice –“continuously applying QA” 17
  • 108. Continuous Integration with Hudson • CI is a well known best practice –“continuously applying QA” • Should be automated 17
  • 109. Continuous Integration with Hudson • CI is a well known best practice –“continuously applying QA” • Should be automated –CI server (Hudson/Jenkins the most popular) 17
  • 110. Continuous Integration with Hudson • CI is a well known best practice –“continuously applying QA” • Should be automated –CI server (Hudson/Jenkins the most popular) • See some examples 17
  • 111. Continuous Integration with Hudson • CI is a well known best practice –“continuously applying QA” • Should be automated –CI server (Hudson/Jenkins the most popular) • See some examples 17
  • 112. Release 18
  • 113. Release • Maven manages a standard release workflow 18
  • 114. Release • Maven manages a standard release workflow –Automatically handles versioning (SNAPSHOT, ...) 18
  • 115. Release • Maven manages a standard release workflow –Automatically handles versioning (SNAPSHOT, ...) –Performs some consistency checks 18
  • 116. Release • Maven manages a standard release workflow –Automatically handles versioning (SNAPSHOT, ...) –Performs some consistency checks –Customizable 18
  • 117. Release • Maven manages a standard release workflow –Automatically handles versioning (SNAPSHOT, ...) –Performs some consistency checks –Customizable • Distribution artifacts can be deployed to a repo 18
  • 118. Release • Maven manages a standard release workflow –Automatically handles versioning (SNAPSHOT, ...) –Performs some consistency checks –Customizable • Distribution artifacts can be deployed to a repo • Releasing can be performed by Hudson 18
  • 119. Release • Maven manages a standard release workflow –Automatically handles versioning (SNAPSHOT, ...) –Performs some consistency checks –Customizable • Distribution artifacts can be deployed to a repo • Releasing can be performed by Hudson –“Push a button” release 18
  • 120. Advanced stuff, tricks and tweaks 19
  • 121. Advanced stuff, tricks and tweaks • They say that Maven is not flexible 19
  • 122. Advanced stuff, tricks and tweaks • They say that Maven is not flexible • It’s not true 19
  • 123. Advanced stuff, tricks and tweaks • They say that Maven is not flexible • It’s not true • It’s flexible if you work in its way 19
  • 124. Advanced stuff, tricks and tweaks • They say that Maven is not flexible • It’s not true • It’s flexible if you work in its way • Some examples in the following slides 19
  • 125. Advanced stuff, tricks and tweaks • They say that Maven is not flexible • It’s not true • It’s flexible if you work in its way • Some examples in the following slides –Maybe overkill 19
  • 126. Advanced stuff, tricks and tweaks • They say that Maven is not flexible • It’s not true • It’s flexible if you work in its way • Some examples in the following slides –Maybe overkill –Maybe tweaks 19
  • 129. Preprocessing AndroidManifest.xml • blueBill Mobile release cycle –production 20
  • 130. Preprocessing AndroidManifest.xml • blueBill Mobile release cycle –production –alpha: can be installed side-by-side, uses separate workarea 20
  • 131. Preprocessing AndroidManifest.xml • blueBill Mobile release cycle –production –alpha: can be installed side-by-side, uses separate workarea –beta: can be installed side-by-side, uses same workakea 20
  • 132. Preprocessing AndroidManifest.xml • blueBill Mobile release cycle –production –alpha: can be installed side-by-side, uses separate workarea –beta: can be installed side-by-side, uses same workakea • Multiple profiles 20
  • 133. Preprocessing AndroidManifest.xml • blueBill Mobile release cycle –production –alpha: can be installed side-by-side, uses separate workarea –beta: can be installed side-by-side, uses same workakea • Multiple profiles –Automatically set versionName from POM 20
  • 134. Preprocessing AndroidManifest.xml • blueBill Mobile release cycle –production –alpha: can be installed side-by-side, uses separate workarea –beta: can be installed side-by-side, uses same workakea • Multiple profiles –Automatically set versionName from POM –Automatically set versionCode 20
  • 135. Preprocessing AndroidManifest.xml • blueBill Mobile release cycle –production –alpha: can be installed side-by-side, uses separate workarea –beta: can be installed side-by-side, uses same workakea • Multiple profiles –Automatically set versionName from POM –Automatically set versionCode –Use different appPackage, label and icon 20
  • 136. Preprocessing AndroidManifest.xml • blueBill Mobile release cycle –production –alpha: can be installed side-by-side, uses separate workarea –beta: can be installed side-by-side, uses same workakea • Multiple profiles –Automatically set versionName from POM –Automatically set versionCode –Use different appPackage, label and icon • Can be done with android:manifest-update goal 20
  • 137. Preprocessing AndroidManifest.xml • blueBill Mobile release cycle –production –alpha: can be installed side-by-side, uses separate workarea –beta: can be installed side-by-side, uses same workakea • Multiple profiles –Automatically set versionName from POM –Automatically set versionCode –Use different appPackage, label and icon • Can be done with android:manifest-update goal • Can be done in other ways 20
  • 138. Preprocessing AndroidManifest.xml • blueBill Mobile release cycle –production –alpha: can be installed side-by-side, uses separate workarea –beta: can be installed side-by-side, uses same workakea • Multiple profiles –Automatically set versionName from POM –Automatically set versionCode –Use different appPackage, label and icon • Can be done with android:manifest-update goal • Can be done in other ways –e.g. the Groovy Maven plugin 20
  • 140. Patching jars • Sometimes you might need to patch some library 21
  • 141. Patching jars • Sometimes you might need to patch some library –Use some JSE runtime classes not available in Android 21
  • 142. Patching jars • Sometimes you might need to patch some library –Use some JSE runtime classes not available in Android –Some Swing stuff, XML stuff (for older Android versions) 21
  • 143. Patching jars • Sometimes you might need to patch some library –Use some JSE runtime classes not available in Android –Some Swing stuff, XML stuff (for older Android versions) • maven-shade-plugin 21
  • 144. Patching jars • Sometimes you might need to patch some library –Use some JSE runtime classes not available in Android –Some Swing stuff, XML stuff (for older Android versions) • maven-shade-plugin –filters: strip some classes out of a jar 21
  • 145. Patching jars • Sometimes you might need to patch some library –Use some JSE runtime classes not available in Android –Some Swing stuff, XML stuff (for older Android versions) • maven-shade-plugin –filters: strip some classes out of a jar –relocations: change class references in the bytecode 21
  • 146. Patching jars • Sometimes you might need to patch some library –Use some JSE runtime classes not available in Android –Some Swing stuff, XML stuff (for older Android versions) • maven-shade-plugin –filters: strip some classes out of a jar –relocations: change class references in the bytecode • See the code example 21
  • 148. Reusing R.java (pre-4.0 trick) • R.java is automatically generated by the SDK 22
  • 149. Reusing R.java (pre-4.0 trick) • R.java is automatically generated by the SDK –It contains constants referring to resources 22
  • 150. Reusing R.java (pre-4.0 trick) • R.java is automatically generated by the SDK –It contains constants referring to resources –“progressive” values 22
  • 151. Reusing R.java (pre-4.0 trick) • R.java is automatically generated by the SDK –It contains constants referring to resources –“progressive” values –uh oh: javac inlines static final variables 22
  • 152. Reusing R.java (pre-4.0 trick) • R.java is automatically generated by the SDK –It contains constants referring to resources –“progressive” values –uh oh: javac inlines static final variables –two R.java’s from two modules are likely to collide 22
  • 153. Reusing R.java (pre-4.0 trick) • R.java is automatically generated by the SDK –It contains constants referring to resources –“progressive” values –uh oh: javac inlines static final variables –two R.java’s from two modules are likely to collide –changed in Android 4.0 22
  • 154. Reusing R.java (pre-4.0 trick) • R.java is automatically generated by the SDK –It contains constants referring to resources –“progressive” values –uh oh: javac inlines static final variables –two R.java’s from two modules are likely to collide –changed in Android 4.0 • What to do? 22
  • 155. Reusing R.java (pre-4.0 trick) • R.java is automatically generated by the SDK –It contains constants referring to resources –“progressive” values –uh oh: javac inlines static final variables –two R.java’s from two modules are likely to collide –changed in Android 4.0 • What to do? • maven-rindirect-plugin 22
  • 156. Reusing R.java (pre-4.0 trick) • R.java is automatically generated by the SDK –It contains constants referring to resources –“progressive” values –uh oh: javac inlines static final variables –two R.java’s from two modules are likely to collide –changed in Android 4.0 • What to do? • maven-rindirect-plugin –generates an “indirect” R.java which delegates 22
  • 157. Reusing R.java (pre-4.0 trick) • R.java is automatically generated by the SDK –It contains constants referring to resources –“progressive” values –uh oh: javac inlines static final variables –two R.java’s from two modules are likely to collide –changed in Android 4.0 • What to do? • maven-rindirect-plugin –generates an “indirect” R.java which delegates • Or a trick with the maven-replacer-plugin 22
  • 158. Why and when? Evaluating whether Maven is the good choice for you
  • 159. Maven is about knowledge reuse 24
  • 160. Maven is about knowledge reuse • According to the Merriam-Webster: 24
  • 161. Maven is about knowledge reuse • According to the Merriam-Webster: –“maven: one who is experienced or knowledgeable” 24
  • 162. Maven is about knowledge reuse • According to the Merriam-Webster: –“maven: one who is experienced or knowledgeable” • Reuse by inheritance and composition 24
  • 163. Maven is about knowledge reuse • According to the Merriam-Webster: –“maven: one who is experienced or knowledgeable” • Reuse by inheritance and composition • It’s about putting your and others’ experience into your build system and reuse it 24
  • 164. Maven is about knowledge reuse • According to the Merriam-Webster: –“maven: one who is experienced or knowledgeable” • Reuse by inheritance and composition • It’s about putting your and others’ experience into your build system and reuse it –the Super POM 24
  • 166. Benefits of Maven • Have a standard project structure for everything 25
  • 167. Benefits of Maven • Have a standard project structure for everything –For JSE, JEE, Android, NetBeans Platform, ... 25
  • 168. Benefits of Maven • Have a standard project structure for everything –For JSE, JEE, Android, NetBeans Platform, ... • Have a standard build workflow and CI 25
  • 169. Benefits of Maven • Have a standard project structure for everything –For JSE, JEE, Android, NetBeans Platform, ... • Have a standard build workflow and CI –Test coverage, static analysis, ... (more later) 25
  • 170. Benefits of Maven • Have a standard project structure for everything –For JSE, JEE, Android, NetBeans Platform, ... • Have a standard build workflow and CI –Test coverage, static analysis, ... (more later) • Have a standard release workflow 25
  • 171. Benefits of Maven • Have a standard project structure for everything –For JSE, JEE, Android, NetBeans Platform, ... • Have a standard build workflow and CI –Test coverage, static analysis, ... (more later) • Have a standard release workflow • Easily include libraries, manage dependencies 25
  • 172. Benefits of Maven • Have a standard project structure for everything –For JSE, JEE, Android, NetBeans Platform, ... • Have a standard build workflow and CI –Test coverage, static analysis, ... (more later) • Have a standard release workflow • Easily include libraries, manage dependencies –Reporting! 25
  • 173. Benefits of Maven • Have a standard project structure for everything –For JSE, JEE, Android, NetBeans Platform, ... • Have a standard build workflow and CI –Test coverage, static analysis, ... (more later) • Have a standard release workflow • Easily include libraries, manage dependencies –Reporting! • IDE neutral 25
  • 174. Benefits of Maven • Have a standard project structure for everything –For JSE, JEE, Android, NetBeans Platform, ... • Have a standard build workflow and CI –Test coverage, static analysis, ... (more later) • Have a standard release workflow • Easily include libraries, manage dependencies –Reporting! • IDE neutral • CLI just works as the IDE 25
  • 175. Benefits of Maven • Have a standard project structure for everything –For JSE, JEE, Android, NetBeans Platform, ... • Have a standard build workflow and CI –Test coverage, static analysis, ... (more later) • Have a standard release workflow • Easily include libraries, manage dependencies –Reporting! • IDE neutral • CLI just works as the IDE • Language neutral (e.g. Scala, Groovy, ...) 25
  • 176. Is Maven the right tool for you? 26
  • 177. Is Maven the right tool for you? • Undoubtedly Maven is more complex 26
  • 178. Is Maven the right tool for you? • Undoubtedly Maven is more complex –in the “entropic” meaning (needed known things) 26
  • 179. Is Maven the right tool for you? • Undoubtedly Maven is more complex –in the “entropic” meaning (needed known things) –simple things are reasonably simple 26
  • 180. Is Maven the right tool for you? • Undoubtedly Maven is more complex –in the “entropic” meaning (needed known things) –simple things are reasonably simple –but you’ll need time to master it 26
  • 181. Is Maven the right tool for you? • Undoubtedly Maven is more complex –in the “entropic” meaning (needed known things) –simple things are reasonably simple –but you’ll need time to master it • Most of people whining about Maven don’t know it well 26
  • 182. Is Maven the right tool for you? • Undoubtedly Maven is more complex –in the “entropic” meaning (needed known things) –simple things are reasonably simple –but you’ll need time to master it • Most of people whining about Maven don’t know it well –but we’ve got different minds and you might not like it 26
  • 183. Is Maven the right tool for you? • Undoubtedly Maven is more complex –in the “entropic” meaning (needed known things) –simple things are reasonably simple –but you’ll need time to master it • Most of people whining about Maven don’t know it well –but we’ve got different minds and you might not like it • For single developers / very simple projects 26
  • 184. Is Maven the right tool for you? • Undoubtedly Maven is more complex –in the “entropic” meaning (needed known things) –simple things are reasonably simple –but you’ll need time to master it • Most of people whining about Maven don’t know it well –but we’ve got different minds and you might not like it • For single developers / very simple projects –might be overkill 26
  • 185. Is Maven the right tool for you? • Undoubtedly Maven is more complex –in the “entropic” meaning (needed known things) –simple things are reasonably simple –but you’ll need time to master it • Most of people whining about Maven don’t know it well –but we’ve got different minds and you might not like it • For single developers / very simple projects –might be overkill –but it’s a matter of reusing knowledge 26
  • 186. Is Maven the right tool for you? • Undoubtedly Maven is more complex –in the “entropic” meaning (needed known things) –simple things are reasonably simple –but you’ll need time to master it • Most of people whining about Maven don’t know it well –but we’ve got different minds and you might not like it • For single developers / very simple projects –might be overkill –but it’s a matter of reusing knowledge • For companies 26
  • 187. Is Maven the right tool for you? • Undoubtedly Maven is more complex –in the “entropic” meaning (needed known things) –simple things are reasonably simple –but you’ll need time to master it • Most of people whining about Maven don’t know it well –but we’ve got different minds and you might not like it • For single developers / very simple projects –might be overkill –but it’s a matter of reusing knowledge • For companies –it’s a must (think of modularization, CI, quality) 26
  • 188. Is Maven the right tool for you? • Undoubtedly Maven is more complex –in the “entropic” meaning (needed known things) –simple things are reasonably simple –but you’ll need time to master it • Most of people whining about Maven don’t know it well –but we’ve got different minds and you might not like it • For single developers / very simple projects –might be overkill –but it’s a matter of reusing knowledge • For companies –it’s a must (think of modularization, CI, quality) –some infrastructure needed (e.g. Nexus) 26
  • 189. Is Maven the right tool for you? • Undoubtedly Maven is more complex –in the “entropic” meaning (needed known things) –simple things are reasonably simple –but you’ll need time to master it • Most of people whining about Maven don’t know it well –but we’ve got different minds and you might not like it • For single developers / very simple projects –might be overkill –but it’s a matter of reusing knowledge • For companies –it’s a must (think of modularization, CI, quality) –some infrastructure needed (e.g. Nexus) 26
  • 190. Resources • http://maven.apache.org • http://sonatype.com/Support/Books • http://code.google.com/p/maven-android-plugin • http://code.google.com/p/robotium • http://simpligility.com/2011/11/apache-maven-at-andevcon-ii • http://bluebill.tidalwave.it/mobile • http://kenai.com/projects/nbandroid • http://rgladwell.github.com/m2e-android/ • http://code.google.com/p/robotium/ • http://github.com/akquinet/android-rindirect 27
  • 191. Question time ... and thanks for your attention! fabrizio.giudici@tidalwave.it http://weblogs.java.net/blog/fabriziogiudici http://fabriziogiudici.it

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. \n
  87. \n
  88. \n
  89. \n
  90. \n
  91. \n
  92. \n
  93. \n
  94. \n
  95. \n
  96. \n
  97. \n
  98. \n
  99. \n
  100. \n
  101. \n
  102. \n
  103. \n
  104. \n
  105. \n
  106. \n
  107. \n
  108. \n
  109. \n
  110. \n
  111. \n
  112. \n
  113. \n
  114. \n
  115. \n
  116. \n
  117. \n
  118. \n
  119. \n
  120. \n
  121. \n
  122. \n
  123. \n
  124. \n
  125. \n
  126. \n
  127. \n
  128. \n
  129. \n
  130. \n
  131. \n
  132. \n
  133. \n
  134. \n
  135. \n
  136. \n
  137. \n
  138. \n
  139. \n
  140. \n
  141. \n
  142. \n
  143. \n
  144. \n
  145. \n
  146. \n
  147. \n
  148. \n
  149. \n
  150. \n
  151. \n
  152. \n
  153. \n
  154. \n
  155. \n
  156. \n
  157. \n
  158. \n
  159. \n
  160. \n
  161. \n
  162. \n
  163. \n
  164. \n
  165. \n
  166. \n
  167. \n
  168. \n
  169. \n
  170. \n
  171. \n
  172. \n
  173. \n
  174. \n
  175. \n
  176. \n
  177. \n
  178. \n
  179. \n
  180. \n
  181. \n
  182. \n
  183. \n
  184. \n
  185. \n
  186. \n
  187. \n
  188. \n
  189. \n
  190. \n
  191. \n
  192. \n
  193. \n
  194. \n
  195. \n
  196. \n
  197. \n
  198. \n
  199. \n