Efficient development
                     of large NetBeans Platform
                             applications
                              with Maven
                                Fabrizio Giudici, Senior Java Architect
                             Tidalwave s.a.s - fabrizio.giudici@tidalwave.it



Friday, September 24, 2010
Agenda




  Efficient development of large NetBeans Platform applications with Maven   2
Friday, September 24, 2010
Agenda

       •       Introducing the NetBeans Platform




  Efficient development of large NetBeans Platform applications with Maven   2
Friday, September 24, 2010
Agenda

       •       Introducing the NetBeans Platform
       •       The NetBeans Platform Ant Build Harness




  Efficient development of large NetBeans Platform applications with Maven   2
Friday, September 24, 2010
Agenda

       •       Introducing the NetBeans Platform
       •       The NetBeans Platform Ant Build Harness
       •       Limitations of the NetBeans Platform Ant Build Harness




  Efficient development of large NetBeans Platform applications with Maven   2
Friday, September 24, 2010
Agenda

       •       Introducing the NetBeans Platform
       •       The NetBeans Platform Ant Build Harness
       •       Limitations of the NetBeans Platform Ant Build Harness
       •       Introducing Maven




  Efficient development of large NetBeans Platform applications with Maven   2
Friday, September 24, 2010
Agenda

       •       Introducing the NetBeans Platform
       •       The NetBeans Platform Ant Build Harness
       •       Limitations of the NetBeans Platform Ant Build Harness
       •       Introducing Maven
       •       The NetBeans Platform Maven Plugin




  Efficient development of large NetBeans Platform applications with Maven   2
Friday, September 24, 2010
Agenda

       •       Introducing the NetBeans Platform
       •       The NetBeans Platform Ant Build Harness
       •       Limitations of the NetBeans Platform Ant Build Harness
       •       Introducing Maven
       •       The NetBeans Platform Maven Plugin
       •       Optimizing NetBeans Platform Maven projects




  Efficient development of large NetBeans Platform applications with Maven   2
Friday, September 24, 2010
Agenda

       •       Introducing the NetBeans Platform
       •       The NetBeans Platform Ant Build Harness
       •       Limitations of the NetBeans Platform Ant Build Harness
       •       Introducing Maven
       •       The NetBeans Platform Maven Plugin
       •       Optimizing NetBeans Platform Maven projects
       •       Reuse of third parties’ libraries (NBPWR project, optional)


  Efficient development of large NetBeans Platform applications with Maven    2
Friday, September 24, 2010
Agenda

       •       Introducing the NetBeans Platform
       •       The NetBeans Platform Ant Build Harness
       •       Limitations of the NetBeans Platform Ant Build Harness
       •       Introducing Maven
       •       The NetBeans Platform Maven Plugin
       •       Optimizing NetBeans Platform Maven projects
       •       Reuse of third parties’ libraries (NBPWR project, optional)
       •       Conclusions

  Efficient development of large NetBeans Platform applications with Maven    2
Friday, September 24, 2010
About the speaker




  Efficient development of large NetBeans Platform applications with Maven   3
Friday, September 24, 2010
About the speaker

       •       Senior Software Architect, Mentor, Technical Writer
       •       Fourteen years of Java Experience (JSE, JEE, JME, etc...)
       •       Sun Consultant since 1998, Oracle consultant since 2010
       •       Author of a number of open source projects
       •       Speaker at JavaOne, Devoxx, Jazoon, JAX Italia and other events
       •       Member of the NetBeans Dream Team
       •       Co-leader of JUG Milano
       •       Java.Net blogger at http://www.java.net/blogs/fabriziogiudici

  Efficient development of large NetBeans Platform applications with Maven        3
Friday, September 24, 2010
Ant vs Maven?




  Efficient development of large NetBeans Platform applications with Maven   4
Friday, September 24, 2010
Ant vs Maven?

       •       What this presentation is not:




  Efficient development of large NetBeans Platform applications with Maven   4
Friday, September 24, 2010
Ant vs Maven?

       •       What this presentation is not:
             •       A “X is better than Y” sermon




  Efficient development of large NetBeans Platform applications with Maven   4
Friday, September 24, 2010
Ant vs Maven?

       •       What this presentation is not:
             •       A “X is better than Y” sermon

       •       What this presentation is:




  Efficient development of large NetBeans Platform applications with Maven   4
Friday, September 24, 2010
Ant vs Maven?

       •       What this presentation is not:
             •       A “X is better than Y” sermon

       •       What this presentation is:
             •       An analysis of scenarios where Maven may serve better than Ant
             •       An analysis of Maven-based NetBeans Platform projects




  Efficient development of large NetBeans Platform applications with Maven             4
Friday, September 24, 2010
Ant vs Maven?

       •       What this presentation is not:
             •       A “X is better than Y” sermon

       •       What this presentation is:
             •       An analysis of scenarios where Maven may serve better than Ant
             •       An analysis of Maven-based NetBeans Platform projects

       •       Some basics about the NetBeans Platform and Maven assumed




  Efficient development of large NetBeans Platform applications with Maven             4
Friday, September 24, 2010
Ant vs Maven?

       •       What this presentation is not:
             •       A “X is better than Y” sermon

       •       What this presentation is:
             •       An analysis of scenarios where Maven may serve better than Ant
             •       An analysis of Maven-based NetBeans Platform projects

       •       Some basics about the NetBeans Platform and Maven assumed
       •       Based on the speaker’s experience of four years with Ant &
               the Platform, then replaced by Maven

  Efficient development of large NetBeans Platform applications with Maven             4
Friday, September 24, 2010
Related talks at JavaOne 2010

       •       S314388: Maven 3.x: The Evolution of Enterprise Java Build
               Infrastructures
       •       S314711: Building Software with Rich Client Platforms
       •       S313667: Swing OSGi Modular Desktop Application Framework
       •       S314266: The Cutting Edge of Desktop Software: The
               NetBeans Platform in Practice
       •       S314141: Patterns for Modularity
       •       S313338 Getting More Out of Your Hudson

  Efficient development of large NetBeans Platform applications with Maven   5
Friday, September 24, 2010
The NetBeans Platform




  Efficient development of large NetBeans Platform applications with Maven   6
Friday, September 24, 2010
The NetBeans Platform


       •       The best framework for Swing desktop applications




  Efficient development of large NetBeans Platform applications with Maven   6
Friday, September 24, 2010
The NetBeans Platform


       •       The best framework for Swing desktop applications
       •       Provides “plumbing” for many common tasks




  Efficient development of large NetBeans Platform applications with Maven   6
Friday, September 24, 2010
The NetBeans Platform


       •       The best framework for Swing desktop applications
       •       Provides “plumbing” for many common tasks
       •       Modular, plugin-oriented, scalable




  Efficient development of large NetBeans Platform applications with Maven   6
Friday, September 24, 2010
The NetBeans Platform


       •       The best framework for Swing desktop applications
       •       Provides “plumbing” for many common tasks
       •       Modular, plugin-oriented, scalable
       •       Since 6.9 provides integration with the OSGi framework




  Efficient development of large NetBeans Platform applications with Maven   6
Friday, September 24, 2010
The NetBeans Platform


       •       The best framework for Swing desktop applications
       •       Provides “plumbing” for many common tasks
       •       Modular, plugin-oriented, scalable
       •       Since 6.9 provides integration with the OSGi framework
       •       Used also as the foundation of the Oracle NetBeans IDE




  Efficient development of large NetBeans Platform applications with Maven   6
Friday, September 24, 2010
The NetBeans Platform


       •       The best framework for Swing desktop applications
       •       Provides “plumbing” for many common tasks
       •       Modular, plugin-oriented, scalable
       •       Since 6.9 provides integration with the OSGi framework
       •       Used also as the foundation of the Oracle NetBeans IDE
       •       Very popular in all the industrial segments


  Efficient development of large NetBeans Platform applications with Maven   6
Friday, September 24, 2010
The NetBeans Platform
                  ... more success stories at
     http://netbeans.org/features/platform/showcase.html


       •       The best framework for Swing desktop applications
       •       Provides “plumbing” for many common tasks
       •       Modular, plugin-oriented, scalable
       •       Since 6.9 provides integration with the OSGi framework
       •       Used also as the foundation of the Oracle NetBeans IDE
       •       Very popular in all the industrial segments


  Efficient development of large NetBeans Platform applications with Maven   6
Friday, September 24, 2010
The Platform Ant Build Harness




  Efficient development of large NetBeans Platform applications with Maven   7
Friday, September 24, 2010
The Platform Ant Build Harness
       •       By default, the NetBeans Platform uses Ant




  Efficient development of large NetBeans Platform applications with Maven   7
Friday, September 24, 2010
The Platform Ant Build Harness
       •       By default, the NetBeans Platform uses Ant
             •       for building itself (together with the IDE)




  Efficient development of large NetBeans Platform applications with Maven   7
Friday, September 24, 2010
The Platform Ant Build Harness
       •       By default, the NetBeans Platform uses Ant
             •       for building itself (together with the IDE)
             •       for building Platform-based applications




  Efficient development of large NetBeans Platform applications with Maven   7
Friday, September 24, 2010
The Platform Ant Build Harness
       •       By default, the NetBeans Platform uses Ant
             •       for building itself (together with the IDE)
             •       for building Platform-based applications

       •       NetBeans Platform Ant Build Harness




  Efficient development of large NetBeans Platform applications with Maven   7
Friday, September 24, 2010
The Platform Ant Build Harness
       •       By default, the NetBeans Platform uses Ant
             •       for building itself (together with the IDE)
             •       for building Platform-based applications

       •       NetBeans Platform Ant Build Harness
             •       Set of standard Ant scripts, tasks and extensions




  Efficient development of large NetBeans Platform applications with Maven   7
Friday, September 24, 2010
The Platform Ant Build Harness
       •       By default, the NetBeans Platform uses Ant
             •       for building itself (together with the IDE)
             •       for building Platform-based applications

       •       NetBeans Platform Ant Build Harness
             •       Set of standard Ant scripts, tasks and extensions
             •       Can be used from the IDE or by the command line




  Efficient development of large NetBeans Platform applications with Maven   7
Friday, September 24, 2010
The Platform Ant Build Harness
       •       By default, the NetBeans Platform uses Ant
             •       for building itself (together with the IDE)
             •       for building Platform-based applications

       •       NetBeans Platform Ant Build Harness
             •       Set of standard Ant scripts, tasks and extensions
             •       Can be used from the IDE or by the command line
                   •         A minimum preliminary setup is required




  Efficient development of large NetBeans Platform applications with Maven   7
Friday, September 24, 2010
The Platform Ant Build Harness
       •       By default, the NetBeans Platform uses Ant
             •       for building itself (together with the IDE)
             •       for building Platform-based applications

       •       NetBeans Platform Ant Build Harness
             •       Set of standard Ant scripts, tasks and extensions
             •       Can be used from the IDE or by the command line
                   •         A minimum preliminary setup is required

             •       Very good starting point for beginners


  Efficient development of large NetBeans Platform applications with Maven   7
Friday, September 24, 2010
The Platform Ant Build Harness
       •       By default, the NetBeans Platform uses Ant
             •       for building itself (together with the IDE)
             •       for building Platform-based applications

       •       NetBeans Platform Ant Build Harness
             •       Set of standard Ant scripts, tasks and extensions
             •       Can be used from the IDE or by the command line
                   •         A minimum preliminary setup is required

             •       Very good starting point for beginners
             •       Many people use it even for complex applications

  Efficient development of large NetBeans Platform applications with Maven   7
Friday, September 24, 2010
Using the Ant Build Harness




  Efficient development of large NetBeans Platform applications with Maven   8
Friday, September 24, 2010
Using the Ant Build Harness


       •       Two ways of using the harness




  Efficient development of large NetBeans Platform applications with Maven   8
Friday, September 24, 2010
Using the Ant Build Harness


       •       Two ways of using the harness
       •       Supplied with the IDE and referred to by the project




  Efficient development of large NetBeans Platform applications with Maven   8
Friday, September 24, 2010
Using the Ant Build Harness


       •       Two ways of using the harness
       •       Supplied with the IDE and referred to by the project
             •       Needs a local environment setup to “point” to the IDE installation folder




  Efficient development of large NetBeans Platform applications with Maven                        8
Friday, September 24, 2010
Using the Ant Build Harness


       •       Two ways of using the harness
       •       Supplied with the IDE and referred to by the project
             •       Needs a local environment setup to “point” to the IDE installation folder

       •       Embedded with the project




  Efficient development of large NetBeans Platform applications with Maven                        8
Friday, September 24, 2010
Using the Ant Build Harness


       •       Two ways of using the harness
       •       Supplied with the IDE and referred to by the project
             •       Needs a local environment setup to “point” to the IDE installation folder

       •       Embedded with the project
             •       Possible clashes if the used Platform version is different than the
                     NetBeans IDE version




  Efficient development of large NetBeans Platform applications with Maven                        8
Friday, September 24, 2010
Using the Ant Build Harness


       •       Two ways of using the harness
       •       Supplied with the IDE and referred to by the project
             •       Needs a local environment setup to “point” to the IDE installation folder

       •       Embedded with the project
             •       Possible clashes if the used Platform version is different than the
                     NetBeans IDE version




  Efficient development of large NetBeans Platform applications with Maven                        8
Friday, September 24, 2010
Using the Ant Build Harness


       •       Two ways of using the harness
       •       Supplied with the IDE and referred to by the project
             •       Needs a local environment setup to “point” to the IDE installation folder

       •       Embedded with the project
             •       Possible clashes if the used Platform version is different than the
                     NetBeans IDE version
                             Key concept: the Ant build harness is
                       a specific build system for the Platform projects

  Efficient development of large NetBeans Platform applications with Maven                        8
Friday, September 24, 2010
When Ant might not scale




  Efficient development of large NetBeans Platform applications with Maven   9
Friday, September 24, 2010
When Ant might not scale

       •       With a large number of modules




  Efficient development of large NetBeans Platform applications with Maven   9
Friday, September 24, 2010
When Ant might not scale

       •       With a large number of modules
             •       Good design practices lead to many small packages




  Efficient development of large NetBeans Platform applications with Maven   9
Friday, September 24, 2010
When Ant might not scale

       •       With a large number of modules
             •       Good design practices lead to many small packages

       •       With multiple projects with many inter-dependencies




  Efficient development of large NetBeans Platform applications with Maven   9
Friday, September 24, 2010
When Ant might not scale

       •       With a large number of modules
             •       Good design practices lead to many small packages

       •       With multiple projects with many inter-dependencies
                                                                       In other words: how to reuse modules?




  Efficient development of large NetBeans Platform applications with Maven                                  9
Friday, September 24, 2010
When Ant might not scale

       •       With a large number of modules
             •       Good design practices lead to many small packages

       •       With multiple projects with many inter-dependencies
                                                                       In other words: how to reuse modules?
             •       Might be a single project that’s worth while splitting




  Efficient development of large NetBeans Platform applications with Maven                                  9
Friday, September 24, 2010
When Ant might not scale

       •       With a large number of modules
             •       Good design practices lead to many small packages

       •       With multiple projects with many inter-dependencies
                                                                       In other words: how to reuse modules?
             •       Might be a single project that’s worth while splitting

       •       What’s a module of the NetBeans Platform, BTW?




  Efficient development of large NetBeans Platform applications with Maven                                  9
Friday, September 24, 2010
When Ant might not scale

       •       With a large number of modules
             •       Good design practices lead to many small packages

       •       With multiple projects with many inter-dependencies
                                                                       In other words: how to reuse modules?
             •       Might be a single project that’s worth while splitting

       •       What’s a module of the NetBeans Platform, BTW?
             •       A collection of cohese packages exposing an API




  Efficient development of large NetBeans Platform applications with Maven                                  9
Friday, September 24, 2010
When Ant might not scale

       •       With a large number of modules
             •       Good design practices lead to many small packages

       •       With multiple projects with many inter-dependencies
                                                                       In other words: how to reuse modules?
             •       Might be a single project that’s worth while splitting

       •       What’s a module of the NetBeans Platform, BTW?
             •       A collection of cohese packages exposing an API
             •       Packed in .nbm files (.jar + metadata)


  Efficient development of large NetBeans Platform applications with Maven                                  9
Friday, September 24, 2010
When Ant might not scale
                             Only a subset of dependencies shown



                                                                            OpenBlueSky



       •       With a large number blueMarine
                          blueMarine
                                     of modules
                                              blueMarine                                             blueMarine
                                               Metadata            Semantic                Media        PDF

             •       Good design practices lead to many small packages
                                              blueMarine           blueMarine         blueMarine     blueMarine

       •
                                                 Core                Catalog            Gallery      LightTable
               With multiple projects with many inter-dependencies
                                                                                      In other words: how to reuse modules?
                                                                                          forceTen
             •       Might be a single project that’s worth while splitting
                                           blueMarine
                                                                      Geo


       •       What’s a module of the NetBeans Platform, BTW?
                                                                   blueMarine

             •       A collection of cohese packages exposing an API
             •       Packed in .nbm files (.jar + metadata) for
                            blueOcean blueBill Server
                                                       blueBill
                                                        Android




  Efficient development of large NetBeans Platform applications with Maven                                                 9
Friday, September 24, 2010
When Ant might not scale

       •       With a large number of modules
             •       Good design practices lead to many small packages

       •       With multiple projects with many inter-dependencies
                                                                       In other words: how to reuse modules?
             •       Might be a single project that’s worth while splitting

       •       What’s a module of the NetBeans Platform, BTW?
             •       A collection of cohese packages exposing an API
             •       Packed in .nbm files (.jar + metadata)


  Efficient development of large NetBeans Platform applications with Maven                                  9
Friday, September 24, 2010
Pushing the Ant Build: Suite Chaining




                                                                            Slide in a graph showing a
                                                                            dependency graph: Suite
                                                                            --> Platform




  Efficient development of large NetBeans Platform applications with Maven                                10
Friday, September 24, 2010
Pushing the Ant Build: Suite Chaining

       •       Platform: a self-contained set of .nbm modules




                                                                            Slide in a graph showing a
                                                                            dependency graph: Suite
                                                                            --> Platform




  Efficient development of large NetBeans Platform applications with Maven                                10
Friday, September 24, 2010
Pushing the Ant Build: Suite Chaining

       •       Platform: a self-contained set of .nbm modules
             •       The NetBeans Platform is obviously one example of a platform




                                                                            Slide in a graph showing a
                                                                            dependency graph: Suite
                                                                            --> Platform




  Efficient development of large NetBeans Platform applications with Maven                                10
Friday, September 24, 2010
Pushing the Ant Build: Suite Chaining

       •       Platform: a self-contained set of .nbm modules
             •       The NetBeans Platform is obviously one example of a platform

       •       Module Suite: a set of .nbm modules depending on a Platform



                                                                            Slide in a graph showing a
                                                                            dependency graph: Suite
                                                                            --> Platform




  Efficient development of large NetBeans Platform applications with Maven                                10
Friday, September 24, 2010
Pushing the Ant Build: Suite Chaining

       •       Platform: a self-contained set of .nbm modules
             •       The NetBeans Platform is obviously one example of a platform

       •       Module Suite: a set of .nbm modules depending on a Platform
             •       Any NetBeans Platform-based project is a suite


                                                                            Slide in a graph showing a
                                                                            dependency graph: Suite
                                                                            --> Platform




  Efficient development of large NetBeans Platform applications with Maven                                10
Friday, September 24, 2010
Pushing the Ant Build: Suite Chaining

       •       Platform: a self-contained set of .nbm modules
             •       The NetBeans Platform is obviously one example of a platform

       •       Module Suite: a set of .nbm modules depending on a Platform
             •       Any NetBeans Platform-based project is a suite

       •       It is possible to have a Suite depending on a Platform +
               another Suite (“Suite Chaining”)                   Slide in a graph showing a
                                                                  dependency graph: Suite
                                                                             --> Platform




  Efficient development of large NetBeans Platform applications with Maven                      10
Friday, September 24, 2010
Pushing the Ant Build: Suite Chaining

       •       Platform: a self-contained set of .nbm modules
             •       The NetBeans Platform is obviously one example of a platform

       •       Module Suite: a set of .nbm modules depending on a Platform
             •       Any NetBeans Platform-based project is a suite

       •       It is possible to have a Suite depending on a Platform +
               another Suite (“Suite Chaining”)                   Slide in a graph showing a
                                                                  dependency graph: Suite
                                                                             --> Platform
             •       Doable, but cumbersome



  Efficient development of large NetBeans Platform applications with Maven                      10
Friday, September 24, 2010
Pushing the Ant Build: Suite Chaining

       •       Platform: a self-contained set of .nbm modules
             •       The NetBeans Platform is obviously one example of a platform

       •       Module Suite: a set of .nbm modules depending on a Platform
             •       Any NetBeans Platform-based project is a suite

       •       It is possible to have a Suite depending on a Platform +
               another Suite (“Suite Chaining”)                   Slide in a graph showing a
                                                                  dependency graph: Suite
                                                                             --> Platform
             •       Doable, but cumbersome
             •       Doesn’t scale well with multiple suite levels


  Efficient development of large NetBeans Platform applications with Maven                      10
Friday, September 24, 2010
Reusing modules with the Ant build harness




  Efficient development of large NetBeans Platform applications with Maven   11
Friday, September 24, 2010
Reusing modules with the Ant build harness

       •       It’s possible to create a custom platform, assembling
               arbitrary .nbm modules




  Efficient development of large NetBeans Platform applications with Maven   11
Friday, September 24, 2010
Reusing modules with the Ant build harness

       •       It’s possible to create a custom platform, assembling
               arbitrary .nbm modules
             •       Of course, dependencies must be satisfied




  Efficient development of large NetBeans Platform applications with Maven   11
Friday, September 24, 2010
Reusing modules with the Ant build harness

       •       It’s possible to create a custom platform, assembling
               arbitrary .nbm modules
             •       Of course, dependencies must be satisfied

       •       You can assemble a Platform feeding the .nbm artifacts from a
               project to another project




  Efficient development of large NetBeans Platform applications with Maven   11
Friday, September 24, 2010
Reusing modules with the Ant build harness

       •       It’s possible to create a custom platform, assembling
               arbitrary .nbm modules
             •       Of course, dependencies must be satisfied

       •       You can assemble a Platform feeding the .nbm artifacts from a
               project to another project
       •       This approach (apparently) scales well beyond the first level




  Efficient development of large NetBeans Platform applications with Maven     11
Friday, September 24, 2010
Reusing modules with the Ant build harness

       •       It’s possible to create a custom platform, assembling
               arbitrary .nbm modules
             •       Of course, dependencies must be satisfied

       •       You can assemble a Platform feeding the .nbm artifacts from a
               project to another project
       •       This approach (apparently) scales well beyond the first level
             •       http://weblogs.java.net/blog/2007/11/03/netbeans-rcp-beyond-suite-chaining




  Efficient development of large NetBeans Platform applications with Maven                    11
Friday, September 24, 2010
Reusing modules with the Ant build harness

       •       It’s possible to create a custom platform, assembling
               arbitrary .nbm modules
             •       Of course, dependencies must be satisfied

       •       You can assemble a Platform feeding the .nbm artifacts from a
               project to another project
       •       This approach (apparently) scales well beyond the first level
             •       http://weblogs.java.net/blog/2007/11/03/netbeans-rcp-beyond-suite-chaining

       •       NetBeans 6.7 introduced support for reusing modules


  Efficient development of large NetBeans Platform applications with Maven                    11
Friday, September 24, 2010
Reusing modules with the Ant build harness

       •       It’s possible to create a custom platform, assembling
               arbitrary .nbm modules
             •       Of course, dependencies must be satisfied

       •       You can assemble a Platform feeding the .nbm artifacts from a
               project to another project
       •       This approach (apparently) scales well beyond the first level
             •       http://weblogs.java.net/blog/2007/11/03/netbeans-rcp-beyond-suite-chaining

       •       NetBeans 6.7 introduced support for reusing modules
             •       http://wiki.netbeans.org/DevFaqHowToReuseModules

  Efficient development of large NetBeans Platform applications with Maven                    11
Friday, September 24, 2010
Reusing modules with the Ant build harness

       •       It’s possible to create a custom platform, assembling
               arbitrary .nbm modules
             •       Of course, dependencies must be satisfied

       •       You can assemble a Platform feeding the .nbm artifacts from a
               project to another project
       •       This approach (apparently) scales well beyond the first level
             •       http://weblogs.java.net/blog/2007/11/03/netbeans-rcp-beyond-suite-chaining

       •       NetBeans 6.7 introduced support for reusing modules
             •       http://wiki.netbeans.org/DevFaqHowToReuseModules

  Efficient development of large NetBeans Platform applications with Maven                    11
Friday, September 24, 2010
Reusing modules with the Ant build harness

       •       It’s possible to create a custom platform, assembling
               arbitrary .nbm modules
             •       Of course, dependencies must be satisfied

       •       You can assemble a Platform feeding the .nbm artifacts from a
               project to another project
       •       This approach (apparently) scales well beyond the first level
             •       http://weblogs.java.net/blog/2007/11/03/netbeans-rcp-beyond-suite-chaining

       •       NetBeans 6.7 introduced support for reusing modules
             •       http://wiki.netbeans.org/DevFaqHowToReuseModules

  Efficient development of large NetBeans Platform applications with Maven                    11
Friday, September 24, 2010
Limits of Custom Platforms with Ant




  Efficient development of large NetBeans Platform applications with Maven   12
Friday, September 24, 2010
Limits of Custom Platforms with Ant
       •       Conceptually simple, the cumbersome part is automating the
               “feed” of NBM artifacts from a project to another




  Efficient development of large NetBeans Platform applications with Maven   12
Friday, September 24, 2010
Limits of Custom Platforms with Ant
       •       Conceptually simple, the cumbersome part is automating the
               “feed” of NBM artifacts from a project to another
       •       Personal experience




  Efficient development of large NetBeans Platform applications with Maven   12
Friday, September 24, 2010
Limits of Custom Platforms with Ant
       •       Conceptually simple, the cumbersome part is automating the
               “feed” of NBM artifacts from a project to another
       •       Personal experience
             •       Wrote a couple of custom Ant tasks to enhance the original
                     harness with artifact management facilities




  Efficient development of large NetBeans Platform applications with Maven         12
Friday, September 24, 2010
Limits of Custom Platforms with Ant
       •       Conceptually simple, the cumbersome part is automating the
               “feed” of NBM artifacts from a project to another
       •       Personal experience
             •       Wrote a couple of custom Ant tasks to enhance the original
                     harness with artifact management facilities
             •       Reached some high complexity when trying to share javadocs and
                     sources too




  Efficient development of large NetBeans Platform applications with Maven         12
Friday, September 24, 2010
Limits of Custom Platforms with Ant
       •       Conceptually simple, the cumbersome part is automating the
               “feed” of NBM artifacts from a project to another
       •       Personal experience
             •       Wrote a couple of custom Ant tasks to enhance the original
                     harness with artifact management facilities
             •       Reached some high complexity when trying to share javadocs and
                     sources too
                   •         Sources in particular are important, e.g. for profiling etc...




  Efficient development of large NetBeans Platform applications with Maven                    12
Friday, September 24, 2010
Limits of Custom Platforms with Ant
       •       Conceptually simple, the cumbersome part is automating the
               “feed” of NBM artifacts from a project to another
       •       Personal experience
             •       Wrote a couple of custom Ant tasks to enhance the original
                     harness with artifact management facilities
             •       Reached some high complexity when trying to share javadocs and
                     sources too
                   •         Sources in particular are important, e.g. for profiling etc...

             •       At this point I moved to Maven...



  Efficient development of large NetBeans Platform applications with Maven                    12
Friday, September 24, 2010
Limits of Custom Platforms with Ant
       •       Conceptually simple, the cumbersome part is automating the
               “feed” of NBM artifacts from a project to another
       •       Personal experience
             •       Wrote a couple of custom Ant tasks to enhance the original
                     harness with artifact management facilities
             •       Reached some high complexity when trying to share javadocs and
                     sources too
                   •         Sources in particular are important, e.g. for profiling etc...

             •       At this point I moved to Maven...

       •       I’m recommending to customers - of course your mileage may vary
  Efficient development of large NetBeans Platform applications with Maven                    12
Friday, September 24, 2010
Introducing Maven




  Efficient development of large NetBeans Platform applications with Maven   13
Friday, September 24, 2010
Introducing Maven

       •       A different building tool than Ant




  Efficient development of large NetBeans Platform applications with Maven   13
Friday, September 24, 2010
Introducing Maven

       •       A different building tool than Ant
       •       Standard lifecycle (= sequence of phases) applied to projects




  Efficient development of large NetBeans Platform applications with Maven      13
Friday, September 24, 2010
Introducing Maven

       •       A different building tool than Ant
       •       Standard lifecycle (= sequence of phases) applied to projects
       •       Projects are described by a POM (Project Object Model)




  Efficient development of large NetBeans Platform applications with Maven      13
Friday, September 24, 2010
Introducing Maven

       •       A different building tool than Ant
       •       Standard lifecycle (= sequence of phases) applied to projects
       •       Projects are described by a POM (Project Object Model)
       •       Composed of plugins attaching goals to phases




  Efficient development of large NetBeans Platform applications with Maven      13
Friday, September 24, 2010
Introducing Maven

       •       A different building tool than Ant
       •       Standard lifecycle (= sequence of phases) applied to projects
       •       Projects are described by a POM (Project Object Model)
       •       Composed of plugins attaching goals to phases
       •       Provides efficient artifact management with repositories




  Efficient development of large NetBeans Platform applications with Maven      13
Friday, September 24, 2010
Introducing Maven

       •       A different building tool than Ant
       •       Standard lifecycle (= sequence of phases) applied to projects
       •       Projects are described by a POM (Project Object Model)
       •       Composed of plugins attaching goals to phases
       •       Provides efficient artifact management with repositories
             •       more info later




  Efficient development of large NetBeans Platform applications with Maven      13
Friday, September 24, 2010
Introducing Maven

       •       A different building tool than Ant
       •       Standard lifecycle (= sequence of phases) applied to projects
       •       Projects are described by a POM (Project Object Model)
       •       Composed of plugins attaching goals to phases
       •       Provides efficient artifact management with repositories
             •       more info later
                  Ant: interpreter
                  to create build scripts



  Efficient development of large NetBeans Platform applications with Maven      13
Friday, September 24, 2010
Introducing Maven

       •       A different building tool than Ant
       •       Standard lifecycle (= sequence of phases) applied to projects
       •       Projects are described by a POM (Project Object Model)
       •       Composed of plugins attaching goals to phases
       •       Provides efficient artifact management with repositories
             •       more info later
                  Ant: interpreter                              Maven: standard, well defined
                  to create build scripts                       build system that can be customized



  Efficient development of large NetBeans Platform applications with Maven                             13
Friday, September 24, 2010
Introducing Maven

       •       A different building tool than Ant
       •       Standard lifecycle (= sequence of phases) applied to projects
       •       Projects are described by a POM (Project Object Model)
       •       Composed of plugins attaching goals to phases
       •       Provides efficient artifact management with repositories
             •       more info later
                  Ant: interpreter                              Maven: standard, well defined
                  to create build scripts                       build system that can be customized

                  Programmatic
  Efficient development of large NetBeans Platform applications with Maven                             13
Friday, September 24, 2010
Introducing Maven

       •       A different building tool than Ant
       •       Standard lifecycle (= sequence of phases) applied to projects
       •       Projects are described by a POM (Project Object Model)
       •       Composed of plugins attaching goals to phases
       •       Provides efficient artifact management with repositories
             •       more info later
                  Ant: interpreter                              Maven: standard, well defined
                  to create build scripts                       build system that can be customized

                  Programmatic                                  Declarative
  Efficient development of large NetBeans Platform applications with Maven                             13
Friday, September 24, 2010
Inheritance and composition




  Efficient development of large NetBeans Platform applications with Maven   14
Friday, September 24, 2010
Inheritance and composition

       •       “Object model” means it implies some typical OO practices




  Efficient development of large NetBeans Platform applications with Maven   14
Friday, September 24, 2010
Inheritance and composition

       •       “Object model” means it implies some typical OO practices
       •       Inheritance




  Efficient development of large NetBeans Platform applications with Maven   14
Friday, September 24, 2010
Inheritance and composition

       •       “Object model” means it implies some typical OO practices
       •       Inheritance
             •       A module POM can inherit from a parent POM




  Efficient development of large NetBeans Platform applications with Maven   14
Friday, September 24, 2010
Inheritance and composition

       •       “Object model” means it implies some typical OO practices
       •       Inheritance
             •       A module POM can inherit from a parent POM

       •       Composition




  Efficient development of large NetBeans Platform applications with Maven   14
Friday, September 24, 2010
Inheritance and composition

       •       “Object model” means it implies some typical OO practices
       •       Inheritance
             •       A module POM can inherit from a parent POM

       •       Composition
             •       A module POM can import parts of other modules POM




  Efficient development of large NetBeans Platform applications with Maven   14
Friday, September 24, 2010
Inheritance and composition

       •       “Object model” means it implies some typical OO practices
       •       Inheritance
             •       A module POM can inherit from a parent POM

       •       Composition
             •       A module POM can import parts of other modules POM

       •       Both practices reduces entropy (DRY)




  Efficient development of large NetBeans Platform applications with Maven   14
Friday, September 24, 2010
Inheritance and composition

       •       “Object model” means it implies some typical OO practices
       •       Inheritance
             •       A module POM can inherit from a parent POM

       •       Composition
             •       A module POM can import parts of other modules POM

       •       Both practices reduces entropy (DRY)
             •       Still verbose because of XML (but it’s syntax, not semantics)



  Efficient development of large NetBeans Platform applications with Maven            14
Friday, September 24, 2010
Inheritance and composition

       •       “Object model” means it implies some typical OO practices
       •       Inheritance
             •       A module POM can inherit from a parent POM

       •       Composition
             •       A module POM can import parts of other modules POM

       •       Both practices reduces entropy (DRY)
             •       Still verbose because of XML (but it’s syntax, not semantics)
             •       Maven 3 allows for more compact syntaxes (e.g. Groovy)

  Efficient development of large NetBeans Platform applications with Maven            14
Friday, September 24, 2010
Artifacts, dependencies, repositories




  Efficient development of large NetBeans Platform applications with Maven   15
Friday, September 24, 2010
Artifacts, dependencies, repositories

       •       Each module




  Efficient development of large NetBeans Platform applications with Maven   15
Friday, September 24, 2010
Artifacts, dependencies, repositories

       •       Each module
             •       Possibly depends on other modules artifacts




  Efficient development of large NetBeans Platform applications with Maven   15
Friday, September 24, 2010
Artifacts, dependencies, repositories

       •       Each module
             •       Possibly depends on other modules artifacts
             •       Produces a single artifact (which might consist in multiple files)




  Efficient development of large NetBeans Platform applications with Maven                15
Friday, September 24, 2010
Artifacts, dependencies, repositories

       •       Each module
             •       Possibly depends on other modules artifacts
             •       Produces a single artifact (which might consist in multiple files)

       •       Each artifact




  Efficient development of large NetBeans Platform applications with Maven                15
Friday, September 24, 2010
Artifacts, dependencies, repositories

       •       Each module
             •       Possibly depends on other modules artifacts
             •       Produces a single artifact (which might consist in multiple files)

       •       Each artifact
             •       Has got unique coordinates: groupId, artifactId, version, packaging, classifier




  Efficient development of large NetBeans Platform applications with Maven                              15
Friday, September 24, 2010
Artifacts, dependencies, repositories

       •       Each module
             •       Possibly depends on other modules artifacts
             •       Produces a single artifact (which might consist in multiple files)

       •       Each artifact
             •       Has got unique coordinates: groupId, artifactId, version, packaging, classifier
             •       Can be retrieved from a local / remote repository




  Efficient development of large NetBeans Platform applications with Maven                              15
Friday, September 24, 2010
Artifacts, dependencies, repositories

       •       Each module
             •       Possibly depends on other modules artifacts
             •       Produces a single artifact (which might consist in multiple files)

       •       Each artifact
             •       Has got unique coordinates: groupId, artifactId, version, packaging, classifier
             •       Can be retrieved from a local / remote repository
             •       Can be published to a local / remote repository


  Efficient development of large NetBeans Platform applications with Maven                              15
Friday, September 24, 2010
The NBM Maven Plugin




  Efficient development of large NetBeans Platform applications with Maven   16
Friday, September 24, 2010
The NBM Maven Plugin

       •       A specific Maven plugin for the NetBeans Platform




  Efficient development of large NetBeans Platform applications with Maven   16
Friday, September 24, 2010
The NBM Maven Plugin

       •       A specific Maven plugin for the NetBeans Platform
             •       Defines the ‘nbm’ packaging




  Efficient development of large NetBeans Platform applications with Maven   16
Friday, September 24, 2010
The NBM Maven Plugin

       •       A specific Maven plugin for the NetBeans Platform
             •       Defines the ‘nbm’ packaging
             •       Creates nbm artifacts




  Efficient development of large NetBeans Platform applications with Maven   16
Friday, September 24, 2010
The NBM Maven Plugin

       •       A specific Maven plugin for the NetBeans Platform
             •       Defines the ‘nbm’ packaging
             •       Creates nbm artifacts
             •       Manages branding




  Efficient development of large NetBeans Platform applications with Maven   16
Friday, September 24, 2010
The NBM Maven Plugin

       •       A specific Maven plugin for the NetBeans Platform
             •       Defines the ‘nbm’ packaging
             •       Creates nbm artifacts
             •       Manages branding
             •       Creates .zip and JNLP distributions




  Efficient development of large NetBeans Platform applications with Maven   16
Friday, September 24, 2010
The NBM Maven Plugin

       •       A specific Maven plugin for the NetBeans Platform
             •       Defines the ‘nbm’ packaging
             •       Creates nbm artifacts
             •       Manages branding
             •       Creates .zip and JNLP distributions
             •       Properly runs the project being developed




  Efficient development of large NetBeans Platform applications with Maven   16
Friday, September 24, 2010
The NBM Maven Plugin

       •       A specific Maven plugin for the NetBeans Platform
             •       Defines the ‘nbm’ packaging
             •       Creates nbm artifacts
             •       Manages branding
             •       Creates .zip and JNLP distributions
             •       Properly runs the project being developed

       •       Out-of-the-box support by the IDE, better integration with 6.9


  Efficient development of large NetBeans Platform applications with Maven   16
Friday, September 24, 2010
Further benefits                     If you have time, demonstrate e.g. FindBugs integration.
                                                                            In any case, connect to the Tidalwave Hudson instance
                                                                            and show some stuff




  Efficient development of large NetBeans Platform applications with Maven                                                              17
Friday, September 24, 2010
Further benefits                     If you have time, demonstrate e.g. FindBugs integration.
                                                                            In any case, connect to the Tidalwave Hudson instance
                                                                            and show some stuff




       •       Your project becomes just a standard Maven project




  Efficient development of large NetBeans Platform applications with Maven                                                              17
Friday, September 24, 2010
Further benefits                     If you have time, demonstrate e.g. FindBugs integration.
                                                                            In any case, connect to the Tidalwave Hudson instance
                                                                            and show some stuff

                                                    No more NetBeans specific “build harness”

       •       Your project becomes just a standard Maven project




  Efficient development of large NetBeans Platform applications with Maven                                                              17
Friday, September 24, 2010
Further benefits                     If you have time, demonstrate e.g. FindBugs integration.
                                                                            In any case, connect to the Tidalwave Hudson instance
                                                                            and show some stuff

                                                    No more NetBeans specific “build harness”

       •       Your project becomes just a standard Maven project
       •       No special build instructions: mvn clean install




  Efficient development of large NetBeans Platform applications with Maven                                                              17
Friday, September 24, 2010
Further benefits                     If you have time, demonstrate e.g. FindBugs integration.
                                                                            In any case, connect to the Tidalwave Hudson instance
                                                                            and show some stuff

                                                    No more NetBeans specific “build harness”

       •       Your project becomes just a standard Maven project
       •       No special build instructions: mvn clean install
       •       IDE - neutral (IDEA, Eclipse)




  Efficient development of large NetBeans Platform applications with Maven                                                              17
Friday, September 24, 2010
Further benefits                     If you have time, demonstrate e.g. FindBugs integration.
                                                                            In any case, connect to the Tidalwave Hudson instance
                                                                            and show some stuff

                                                    No more NetBeans specific “build harness”

       •       Your project becomes just a standard Maven project
       •       No special build instructions: mvn clean install
       •       IDE - neutral (IDEA, Eclipse)
       •       Immediately available for CI without any specific setup




  Efficient development of large NetBeans Platform applications with Maven                                                              17
Friday, September 24, 2010
Further benefits                     If you have time, demonstrate e.g. FindBugs integration.
                                                                            In any case, connect to the Tidalwave Hudson instance
                                                                            and show some stuff

                                                    No more NetBeans specific “build harness”

       •       Your project becomes just a standard Maven project
       •       No special build instructions: mvn clean install
       •       IDE - neutral (IDEA, Eclipse)
       •       Immediately available for CI without any specific setup
       •       Easy to augment with QA plugins (e.g. Cobertura, FindBugs)




  Efficient development of large NetBeans Platform applications with Maven                                                              17
Friday, September 24, 2010
Further benefits                     If you have time, demonstrate e.g. FindBugs integration.
                                                                            In any case, connect to the Tidalwave Hudson instance
                                                                            and show some stuff

                                                    No more NetBeans specific “build harness”

       •       Your project becomes just a standard Maven project
       •       No special build instructions: mvn clean install
       •       IDE - neutral (IDEA, Eclipse)
       •       Immediately available for CI without any specific setup
       •       Easy to augment with QA plugins (e.g. Cobertura, FindBugs)
             •       Just configure the plugin in the Master POM




  Efficient development of large NetBeans Platform applications with Maven                                                              17
Friday, September 24, 2010
Further benefits                     If you have time, demonstrate e.g. FindBugs integration.
                                                                            In any case, connect to the Tidalwave Hudson instance
                                                                            and show some stuff

                                                    No more NetBeans specific “build harness”

       •       Your project becomes just a standard Maven project
       •       No special build instructions: mvn clean install
       •       IDE - neutral (IDEA, Eclipse)
       •       Immediately available for CI without any specific setup
       •       Easy to augment with QA plugins (e.g. Cobertura, FindBugs)
             •       Just configure the plugin in the Master POM

             •       Run it (e.g. mvn findbugs:findbugs)


  Efficient development of large NetBeans Platform applications with Maven                                                              17
Friday, September 24, 2010
Project structure




  Efficient development of large NetBeans Platform applications with Maven   18
Friday, September 24, 2010
Project structure

       •       Modules                                                      Master POM


             •       Master POM
             •       Application module                                             1      Branding
                                                                                          Module POM


                   •         What and how to assemble as final app
                                                                                    1
             •       Branding module                                                       Application
                                                                                          Module POM


                   •         e.g. i18n resources, customization of
                             existing platform resources                            *
                                                                                         Other NBM POM

             •       One or more .nbm modules


  Efficient development of large NetBeans Platform applications with Maven                                18
Friday, September 24, 2010
Demo




  Efficient development of large NetBeans Platform applications with Maven   19
Friday, September 24, 2010
Demo




       •       Show forceTen Example 1




  Efficient development of large NetBeans Platform applications with Maven   19
Friday, September 24, 2010
Dependency caveat!




  Efficient development of large NetBeans Platform applications with Maven   20
Friday, September 24, 2010
Dependency caveat!
       •       Maven dependencies are transitive




  Efficient development of large NetBeans Platform applications with Maven   20
Friday, September 24, 2010
Dependency caveat!
       •       Maven dependencies are transitive
       •       NetBeans Platform dependencies are not transitive




  Efficient development of large NetBeans Platform applications with Maven   20
Friday, September 24, 2010
Dependency caveat!
       •       Maven dependencies are transitive
       •       NetBeans Platform dependencies are not transitive
       •        The Maven plugin:




  Efficient development of large NetBeans Platform applications with Maven   20
Friday, September 24, 2010
Dependency caveat!
       •       Maven dependencies are transitive
       •       NetBeans Platform dependencies are not transitive
       •         The Maven plugin:
             •       automatically translates direct Maven dependencies on NBM
                     modules to Platform dependencies




  Efficient development of large NetBeans Platform applications with Maven        20
Friday, September 24, 2010
Dependency caveat!
       •       Maven dependencies are transitive
       •       NetBeans Platform dependencies are not transitive
       •         The Maven plugin:
             •       automatically translates direct Maven dependencies on NBM
                     modules to Platform dependencies
             •       performs a consistency check about missing transitive
                     dependencies and dependencies on non-public classes




  Efficient development of large NetBeans Platform applications with Maven        20
Friday, September 24, 2010
Dependency caveat!
       •       Maven dependencies are transitive
       •       NetBeans Platform dependencies are not transitive
       •         The Maven plugin:
             •       automatically translates direct Maven dependencies on NBM
                     modules to Platform dependencies
             •       performs a consistency check about missing transitive
                     dependencies and dependencies on non-public classes

       •       OSGi bundles allowed as dependencies since IDE 6.9 + NBM plugin 3.2



  Efficient development of large NetBeans Platform applications with Maven        20
Friday, September 24, 2010
Dependency caveat!
       •       Maven dependencies are transitive
       •       NetBeans Platform dependencies are not transitive
       •         The Maven plugin:
             •       automatically translates direct Maven dependencies on NBM
                     modules to Platform dependencies
             •       performs a consistency check about missing transitive
                     dependencies and dependencies on non-public classes

       •       OSGi bundles allowed as dependencies since IDE 6.9 + NBM plugin 3.2
       •       Old versions of the plugin behaved in a different way


  Efficient development of large NetBeans Platform applications with Maven        20
Friday, September 24, 2010
Dependency caveat!
       •       Maven dependencies are transitive
       •       NetBeans Platform dependencies are not transitive
       •         The Maven plugin:
             •       automatically translates direct Maven dependencies on NBM
                     modules to Platform dependencies
             •       performs a consistency check about missing transitive
                     dependencies and dependencies on non-public classes

       •       OSGi bundles allowed as dependencies since IDE 6.9 + NBM plugin 3.2
       •       Old versions of the plugin behaved in a different way
             •       Not mentioning some deprecated practices still available in 3.x
  Efficient development of large NetBeans Platform applications with Maven              20
Friday, September 24, 2010
Reuse of NBM modules in non-platform projects




  Efficient development of large NetBeans Platform applications with Maven   21
Friday, September 24, 2010
Reuse of NBM modules in non-platform projects

       •       The NBM Maven plugin produces both a .nbm and a .jar
               artifacts (different packagings)




  Efficient development of large NetBeans Platform applications with Maven   21
Friday, September 24, 2010
Reuse of NBM modules in non-platform projects

       •       The NBM Maven plugin produces both a .nbm and a .jar
               artifacts (different packagings)
       •       This means that a non-platform project can reuse a NBM
               module




  Efficient development of large NetBeans Platform applications with Maven   21
Friday, September 24, 2010
Reuse of NBM modules in non-platform projects

       •       The NBM Maven plugin produces both a .nbm and a .jar
               artifacts (different packagings)
       •       This means that a non-platform project can reuse a NBM
               module
             •       E.g. Java SE, Android, etc...




  Efficient development of large NetBeans Platform applications with Maven   21
Friday, September 24, 2010
Reuse of NBM modules in non-platform projects

       •       The NBM Maven plugin produces both a .nbm and a .jar
               artifacts (different packagings)
       •       This means that a non-platform project can reuse a NBM
               module
             •       E.g. Java SE, Android, etc...

       •       Just declare a dependency as usual




  Efficient development of large NetBeans Platform applications with Maven   21
Friday, September 24, 2010
Reuse of NBM modules in non-platform projects

       •       The NBM Maven plugin produces both a .nbm and a .jar
               artifacts (different packagings)
       •       This means that a non-platform project can reuse a NBM
               module
             •       E.g. Java SE, Android, etc...

       •       Just declare a dependency as usual
             •       Projects whose packaging is nbm automatically depend on nbm artifacts




  Efficient development of large NetBeans Platform applications with Maven               21
Friday, September 24, 2010
Reuse of NBM modules in non-platform projects

       •       The NBM Maven plugin produces both a .nbm and a .jar
               artifacts (different packagings)
       •       This means that a non-platform project can reuse a NBM
               module
             •       E.g. Java SE, Android, etc...

       •       Just declare a dependency as usual
             •       Projects whose packaging is nbm automatically depend on nbm artifacts
             •       Projects whose packaging is jar automatically depend on jar artifacts


  Efficient development of large NetBeans Platform applications with Maven                    21
Friday, September 24, 2010
Demo




       •       Show forceTen Example 2




  Efficient development of large NetBeans Platform applications with Maven   22
Friday, September 24, 2010
Module versioning strategies




  Efficient development of large NetBeans Platform applications with Maven   23
Friday, September 24, 2010
Module versioning strategies

       •       Every module artifact shares the same version of the project




  Efficient development of large NetBeans Platform applications with Maven     23
Friday, September 24, 2010
Module versioning strategies

       •       Every module artifact shares the same version of the project
             •       Simpler to manage




  Efficient development of large NetBeans Platform applications with Maven     23
Friday, September 24, 2010
Module versioning strategies

       •       Every module artifact shares the same version of the project
             •       Simpler to manage
             •       Used by NetBeans for publishing Maven artifacts (e.g.
                     NETBEANS691)




  Efficient development of large NetBeans Platform applications with Maven     23
Friday, September 24, 2010
Module versioning strategies

       •       Every module artifact shares the same version of the project
             •       Simpler to manage
             •       Used by NetBeans for publishing Maven artifacts (e.g.
                     NETBEANS691)
                   •         Trick - indeed every NetBeans module has got its own version




  Efficient development of large NetBeans Platform applications with Maven                   23
Friday, September 24, 2010
Module versioning strategies

       •       Every module artifact shares the same version of the project
             •       Simpler to manage
             •       Used by NetBeans for publishing Maven artifacts (e.g.
                     NETBEANS691)
                   •         Trick - indeed every NetBeans module has got its own version

       •       Every module artifact has got its own version number




  Efficient development of large NetBeans Platform applications with Maven                   23
Friday, September 24, 2010
Module versioning strategies

       •       Every module artifact shares the same version of the project
             •       Simpler to manage
             •       Used by NetBeans for publishing Maven artifacts (e.g.
                     NETBEANS691)
                   •         Trick - indeed every NetBeans module has got its own version

       •       Every module artifact has got its own version number
             •       Slightly more complex to manage




  Efficient development of large NetBeans Platform applications with Maven                   23
Friday, September 24, 2010
Module versioning strategies

       •       Every module artifact shares the same version of the project
             •       Simpler to manage
             •       Used by NetBeans for publishing Maven artifacts (e.g.
                     NETBEANS691)
                   •         Trick - indeed every NetBeans module has got its own version

       •       Every module artifact has got its own version number
             •       Slightly more complex to manage
             •       Required if your modules might move from a project to another


  Efficient development of large NetBeans Platform applications with Maven                   23
Friday, September 24, 2010
Smart dependency convergence




  Efficient development of large NetBeans Platform applications with Maven   24
Friday, September 24, 2010
Smart dependency convergence


       •       The <dependencyManagement> section




  Efficient development of large NetBeans Platform applications with Maven   24
Friday, September 24, 2010
Smart dependency convergence


       •       The <dependencyManagement> section
             •       Declare all the versions of the dependencies used in a project just
                     once, in a parent POM (DRY)




  Efficient development of large NetBeans Platform applications with Maven              24
Friday, September 24, 2010
Smart dependency convergence


       •       The <dependencyManagement> section
             •       Declare all the versions of the dependencies used in a project just
                     once, in a parent POM (DRY)
             •       Children POMs won’t need to declare the version again




  Efficient development of large NetBeans Platform applications with Maven              24
Friday, September 24, 2010
<dependencyManagement>


                    Smart dependency convergence
                     <dependencies>
                         <dependency>
                             <groupId>it.tidalwave.netbeans</groupId>
                             <artifactId>it-tidalwave-netbeans-capabilitiesprovider</artifactId>
                             <version>1.1.26</version>
                         </dependency>
                         <dependency>
                             <groupId>it.tidalwave.netbeans</groupId>
                             <artifactId>it-tidalwave-netbeans-docking</artifactId>
                             <version>1.1.14</version>

       •       The <dependencyManagement> section
                         </dependency>
                         ...
                     </dependencies>

             •
                 </dependencyManagement>
                     Declare all the versions of the dependencies used in a project just
                     once, in a parent POM (DRY)
             •       Children POMs won’t need to declare the version again




  Efficient development of large NetBeans Platform applications with Maven                          24
Friday, September 24, 2010
<dependencyManagement>


                    Smart dependency convergence
                     <dependencies>
                         <dependency>
                             <groupId>it.tidalwave.netbeans</groupId>
                             <artifactId>it-tidalwave-netbeans-capabilitiesprovider</artifactId>
                             <version>1.1.26</version>
                         </dependency>
                         <dependency>
                             <groupId>it.tidalwave.netbeans</groupId>
                             <artifactId>it-tidalwave-netbeans-docking</artifactId>
                             <version>1.1.14</version>

       •       The <dependencyManagement> section
                         </dependency>
                         ...
                     </dependencies>

             •
                 </dependencyManagement>
                     Declare all the versions of the dependencies used in a project just
                     once, in a parent POM (DRY)
             •       Children POMs won’t need to declare the version again

       •       The <dependencyManagement> section can be imported




  Efficient development of large NetBeans Platform applications with Maven                          24
Friday, September 24, 2010
<dependencyManagement>


                    Smart dependency convergence
                     <dependencies>
                         <dependency>
                             <groupId>it.tidalwave.netbeans</groupId>
                             <artifactId>it-tidalwave-netbeans-capabilitiesprovider</artifactId>
                             <version>1.1.26</version>
                         </dependency>
                         <dependency>
                             <groupId>it.tidalwave.netbeans</groupId>
                             <artifactId>it-tidalwave-netbeans-docking</artifactId>
                             <version>1.1.14</version>

       •       The <dependencyManagement> section
                         </dependency>
                         ...
                     </dependencies>

             •
                 </dependencyManagement>
                     Declare all the versions of the dependencies used in a project just
                     once, in a parent POM (DRY)
             •       Children POMs won’t need to declare the version again

       •       The <dependencyManagement> section can be imported
             •       Import a single POM specifying its single version




  Efficient development of large NetBeans Platform applications with Maven                          24
Friday, September 24, 2010
<dependencyManagement>


                    Smart dependency convergence
                     <dependencies>
                         <dependency>
                             <groupId>it.tidalwave.netbeans</groupId>
                             <artifactId>it-tidalwave-netbeans-capabilitiesprovider</artifactId>
                             <version>1.1.26</version>
                         </dependency>
                         <dependency>
                             <groupId>it.tidalwave.netbeans</groupId>
                             <artifactId>it-tidalwave-netbeans-docking</artifactId>
                             <version>1.1.14</version>

       •       The <dependencyManagement> section
                         </dependency>
                         ...
                     </dependencies>

             •
                 </dependencyManagement>
                     Declare all the versions of the dependencies used in a project just
                     once, in a parent POM (DRY)
             •       Children POMs won’t need to declare the version again

       •       The <dependencyManagement> section can be imported
             •       Import a single POM specifying its single version
             •       Maven will “unpack” from it all the declared versions at once



  Efficient development of large NetBeans Platform applications with Maven                          24
Friday, September 24, 2010
<dependencyManagement>


                    Smart dependency convergence
                     <dependencies>
                         <dependency>
                             <groupId>it.tidalwave.netbeans</groupId>
                             <artifactId>it-tidalwave-netbeans-capabilitiesprovider</artifactId>
                             <version>1.1.26</version>
                         </dependency>
                         <dependency>
                             <groupId>it.tidalwave.netbeans</groupId>
                             <artifactId>it-tidalwave-netbeans-docking</artifactId>
                             <version>1.1.14</version>

       •       The <dependencyManagement> section
                         </dependency>
                         ...
                     </dependencies>

             •
                 </dependencyManagement>
                   Declare all the versions of the dependencies used in a project just
                   once, in a parent POM (DRY)
                 <dependencyManagement>
                     <dependencies>
                         <dependency>
             •       Children POMs won’t need to declare the version again
                             <groupId>it.tidalwave.semantic</groupId>
                             <artifactId>semantic</artifactId>
                             <version>0.10.19</version>

       •       The <dependencyManagement> section can be imported
                             <type>pom</type>
                             <scope>import</scope>
                         </dependency>

             •           <dependency>
                     Import a single POM specifying its single version
                             <groupId>it.tidalwave.netbeans</groupId>
                             <artifactId>openbluesky</artifactId>

             •               <version>0.8.4</version>
                     Maven will “unpack” from it all the declared versions at once
                             <type>pom</type>
                             <scope>import</scope>
                         </dependency>
                         ...
                     </dependencies>
                 </dependencyManagement>
  Efficient development of large NetBeans Platform applications with Maven                          24
Friday, September 24, 2010
Optimizing a Maven Platform project




  Efficient development of large NetBeans Platform applications with Maven   25
Friday, September 24, 2010
Optimizing a Maven Platform project


         Master POM




                    1          Branding
                              Module POM




                    1          Application
                              Module POM




                    *
                             Other NBM POM




  Efficient development of large NetBeans Platform applications with Maven   25
Friday, September 24, 2010
Optimizing a Maven Platform project

                                                       Master POM



         Master POM
                                                                1
                                                                      Modules POM


                    1          Branding
                              Module POM
                                                                              1
                                                                                      Branding
                                                                                     Module POM

                    1          Application
                              Module POM
                                                                              1
                                                                                      Application
                                                                                     Module POM

                    *
                             Other NBM POM
                                                                              *
                                                                                    Other NBM POM




  Efficient development of large NetBeans Platform applications with Maven                           25
Friday, September 24, 2010
Optimizing a Maven Platform project

                                                         Master POM



         Master POM
                                                                      1
                                                                           Modules POM

                                                      Contains
                    1          Branding
                                               dependencyManagement of
                                                modules imported by this
                              Module POM                project
                                                                                   1
                                                                                           Branding
                                                                                          Module POM

                    1          Application
                              Module POM
                                                                                   1
                                                                                           Application
                                                                                          Module POM

                    *
                             Other NBM POM
                                                                                   *
                                                                                         Other NBM POM




  Efficient development of large NetBeans Platform applications with Maven                                25
Friday, September 24, 2010
Optimizing a Maven Platform project

                                              Contains
                                       dependencyManagement of               Master POM
                                        modules exported by this
                                               project


         Master POM
                                                                                          1
                                                                                               Modules POM

                                                                          Contains
                    1          Branding
                                                                   dependencyManagement of
                                                                    modules imported by this
                              Module POM                                    project
                                                                                                       1
                                                                                                               Branding
                                                                                                              Module POM

                    1          Application
                              Module POM
                                                                                                       1
                                                                                                               Application
                                                                                                              Module POM

                    *
                             Other NBM POM
                                                                                                       *
                                                                                                             Other NBM POM




  Efficient development of large NetBeans Platform applications with Maven                                                    25
Friday, September 24, 2010
Optimizing a Maven Platform project
                                                                                                       A single POM import
                                                                                                      retrieves all the correct
                                                                                                       modules versions in a
                                                                                                           consistent way

                                                                                                                                  Other project
                                              Contains                                                                               POM
                                       dependencyManagement of               Master POM                 <<imports>>
                                        modules exported by this
                                               project


         Master POM
                                                                                          1
                                                                                               Modules POM

                                                                          Contains
                    1          Branding
                                                                   dependencyManagement of
                                                                    modules imported by this
                              Module POM                                    project
                                                                                                       1
                                                                                                                   Branding
                                                                                                                  Module POM

                    1          Application
                              Module POM
                                                                                                       1
                                                                                                                   Application
                                                                                                                  Module POM

                    *
                             Other NBM POM
                                                                                                       *
                                                                                                               Other NBM POM




  Efficient development of large NetBeans Platform applications with Maven                                                                         25
Friday, September 24, 2010
The NBPWR project
                                                       From there, it’s optional. If you ran out of
                                                       time, just mention the project




  Efficient development of large NetBeans Platform applications with Maven                             26
Friday, September 24, 2010
The NBPWR project
                                                       From there, it’s optional. If you ran out of
                                                       time, just mention the project




       •       The NetBeans Platform needs to “wrap” non-platform jar libraries




  Efficient development of large NetBeans Platform applications with Maven                             26
Friday, September 24, 2010
The NBPWR project
                                                       From there, it’s optional. If you ran out of
                                                       time, just mention the project




       •       The NetBeans Platform needs to “wrap” non-platform jar libraries
             •       Declare public API, dependencies, other platform properties, ...




  Efficient development of large NetBeans Platform applications with Maven                             26
Friday, September 24, 2010
The NBPWR project
                                                       From there, it’s optional. If you ran out of
                                                       time, just mention the project




       •       The NetBeans Platform needs to “wrap” non-platform jar libraries
             •       Declare public API, dependencies, other platform properties, ...

       •       Not hard, but it’s a waste to redo the same thing over and
               over for multiple projects




  Efficient development of large NetBeans Platform applications with Maven                             26
Friday, September 24, 2010
The NBPWR project
                                                       From there, it’s optional. If you ran out of
                                                       time, just mention the project




       •       The NetBeans Platform needs to “wrap” non-platform jar libraries
             •       Declare public API, dependencies, other platform properties, ...

       •       Not hard, but it’s a waste to redo the same thing over and
               over for multiple projects
       •       The “NetBeans Platform Wrapper Repository” project
               provides reusable wrappers for some common FLOSS
               libraries



  Efficient development of large NetBeans Platform applications with Maven                             26
Friday, September 24, 2010
NBPWR issues




  Efficient development of large NetBeans Platform applications with Maven   27
Friday, September 24, 2010
NBPWR issues

       •       Needs an alternate coordinate schema




  Efficient development of large NetBeans Platform applications with Maven   27
Friday, September 24, 2010
NBPWR issues

       •       Needs an alternate coordinate schema
             •       Can’t use the original artifact coordinates + changing the packaging




  Efficient development of large NetBeans Platform applications with Maven                   27
Friday, September 24, 2010
NBPWR issues

       •       Needs an alternate coordinate schema
             •       Can’t use the original artifact coordinates + changing the packaging
             •       Also for having dependencies on a wrapped NBM, not the original JAR




  Efficient development of large NetBeans Platform applications with Maven                   27
Friday, September 24, 2010
NBPWR issues
                                                                   org.swinglabs:swingx:1.6
                                                                           becomes
                                                     com.kenai.nbpwr:org-jdesktop-swingx:1.6-201002261215

       •       Needs an alternate coordinate schema
             •       Can’t use the original artifact coordinates + changing the packaging
             •       Also for having dependencies on a wrapped NBM, not the original JAR




  Efficient development of large NetBeans Platform applications with Maven                                   27
Friday, September 24, 2010
NBPWR issues
                                                                   org.swinglabs:swingx:1.6
                                                                           becomes
                                                     com.kenai.nbpwr:org-jdesktop-swingx:1.6-201002261215

       •       Needs an alternate coordinate schema
             •       Can’t use the original artifact coordinates + changing the packaging
             •       Also for having dependencies on a wrapped NBM, not the original JAR

       •       Needs a further versioning qualifier




  Efficient development of large NetBeans Platform applications with Maven                                   27
Friday, September 24, 2010
NBPWR issues
                                                                   org.swinglabs:swingx:1.6
                                                                           becomes
                                                     com.kenai.nbpwr:org-jdesktop-swingx:1.6-201002261215

       •       Needs an alternate coordinate schema
             •       Can’t use the original artifact coordinates + changing the packaging
             •       Also for having dependencies on a wrapped NBM, not the original JAR

       •       Needs a further versioning qualifier
             •       Errors might be done e.g. in declaring the public API, thus needing
                     a fix release targeting the same original library version




  Efficient development of large NetBeans Platform applications with Maven                                   27
Friday, September 24, 2010
NBPWR issues
                                                                   org.swinglabs:swingx:1.6
                                                                           becomes
                                                     com.kenai.nbpwr:org-jdesktop-swingx:1.6-201002261215

       •       Needs an alternate coordinate schema
             •       Can’t use the original artifact coordinates + changing the packaging
             •       Also for having dependencies on a wrapped NBM, not the original JAR

       •       Needs a further versioning qualifier
             •       Errors might be done e.g. in declaring the public API, thus needing
                     a fix release targeting the same original library version

       •       It’s possible to attach original sources and javadocs



  Efficient development of large NetBeans Platform applications with Maven                                   27
Friday, September 24, 2010
NBPWR issues
                                                                   org.swinglabs:swingx:1.6
                                                                           becomes
                                                     com.kenai.nbpwr:org-jdesktop-swingx:1.6-201002261215

       •       Needs an alternate coordinate schema
             •       Can’t use the original artifact coordinates + changing the packaging
             •       Also for having dependencies on a wrapped NBM, not the original JAR

       •       Needs a further versioning qualifier
             •       Errors might be done e.g. in declaring the public API, thus needing
                     a fix release targeting the same original library version

       •       It’s possible to attach original sources and javadocs
       •       Granularity: one .nbm per .jar or aggregates?

  Efficient development of large NetBeans Platform applications with Maven                                   27
Friday, September 24, 2010
NBPWR usage




  Efficient development of large NetBeans Platform applications with Maven   28
Friday, September 24, 2010
NBPWR usage



       •       You might not like some NBPWR decisions




  Efficient development of large NetBeans Platform applications with Maven   28
Friday, September 24, 2010
NBPWR usage



       •       You might not like some NBPWR decisions
             •       Interested in feedback about this!




  Efficient development of large NetBeans Platform applications with Maven   28
Friday, September 24, 2010
NBPWR usage



       •       You might not like some NBPWR decisions
             •       Interested in feedback about this!

       •       Still, a NBPWR-like approach is time-saving inside a given
               corporate / workgroup




  Efficient development of large NetBeans Platform applications with Maven   28
Friday, September 24, 2010
NBPWR usage



       •       You might not like some NBPWR decisions
             •       Interested in feedback about this!

       •       Still, a NBPWR-like approach is time-saving inside a given
               corporate / workgroup
       •       Cooperating, it could become a standard way of doing things




  Efficient development of large NetBeans Platform applications with Maven    28
Friday, September 24, 2010
Conclusion




  Efficient development of large NetBeans Platform applications with Maven   29
Friday, September 24, 2010
Conclusion
       •       The NB Platform is a highly modular and scalable framework




  Efficient development of large NetBeans Platform applications with Maven   29
Friday, September 24, 2010
Conclusion
       •       The NB Platform is a highly modular and scalable framework
       •       The And Build Harness might not scale with your needs




  Efficient development of large NetBeans Platform applications with Maven   29
Friday, September 24, 2010
Conclusion
       •       The NB Platform is a highly modular and scalable framework
       •       The And Build Harness might not scale with your needs
             •       Cross-dependencies in large projects might be a problem




  Efficient development of large NetBeans Platform applications with Maven      29
Friday, September 24, 2010
Conclusion
       •       The NB Platform is a highly modular and scalable framework
       •       The And Build Harness might not scale with your needs
             •       Cross-dependencies in large projects might be a problem

       •       Maven is a valuable and effective alternative




  Efficient development of large NetBeans Platform applications with Maven      29
Friday, September 24, 2010
Conclusion
       •       The NB Platform is a highly modular and scalable framework
       •       The And Build Harness might not scale with your needs
             •       Cross-dependencies in large projects might be a problem

       •       Maven is a valuable and effective alternative
             •       Intuitive artifact management and cross-dependency management




  Efficient development of large NetBeans Platform applications with Maven            29
Friday, September 24, 2010
Conclusion
       •       The NB Platform is a highly modular and scalable framework
       •       The And Build Harness might not scale with your needs
             •       Cross-dependencies in large projects might be a problem

       •       Maven is a valuable and effective alternative
             •       Intuitive artifact management and cross-dependency management
             •       Your Platform project just becomes a standard Maven project




  Efficient development of large NetBeans Platform applications with Maven            29
Friday, September 24, 2010
Conclusion
       •       The NB Platform is a highly modular and scalable framework
       •       The And Build Harness might not scale with your needs
             •       Cross-dependencies in large projects might be a problem

       •       Maven is a valuable and effective alternative
             •       Intuitive artifact management and cross-dependency management
             •       Your Platform project just becomes a standard Maven project
             •       Can be used with other IDEs - easy QA & Continuous Integration




  Efficient development of large NetBeans Platform applications with Maven            29
Friday, September 24, 2010
Conclusion
       •       The NB Platform is a highly modular and scalable framework
       •       The And Build Harness might not scale with your needs
             •       Cross-dependencies in large projects might be a problem

       •       Maven is a valuable and effective alternative
             •       Intuitive artifact management and cross-dependency management
             •       Your Platform project just becomes a standard Maven project
             •       Can be used with other IDEs - easy QA & Continuous Integration
             •       Beware: to be effective, Maven needs some pieces of infrastructure!


  Efficient development of large NetBeans Platform applications with Maven                  29
Friday, September 24, 2010
Conclusion
       •       The NB Platform is a highly modular and scalable framework
       •       The And Build Harness might not scale with your needs
             •       Cross-dependencies in large projects might be a problem

       •       Maven is a valuable and effective alternative
             •       Intuitive artifact management and cross-dependency management
             •       Your Platform project just becomes a standard Maven project
             •       Can be used with other IDEs - easy QA & Continuous Integration
             •       Beware: to be effective, Maven needs some pieces of infrastructure!

       •       Ant vs Maven is partly subjective
  Efficient development of large NetBeans Platform applications with Maven                  29
Friday, September 24, 2010
Question time




  Efficient development of large NetBeans Platform applications with Maven   30
Friday, September 24, 2010
Question time

       •       Follow me
             •       at my Java.Net blog
             •       at DZone

       •       Useful links
             •       http://platform.netbeans.org
             •       http://wiki.netbeans.org/MavenBestPractices
             •       http://forceten.tidalwave.it/development/tutorials/using-the-geoexplorer-
                     and-the-geoviewer/
             •       http://bluemarine.tidalwave.it

  Efficient development of large NetBeans Platform applications with Maven                        30
Friday, September 24, 2010

Netbeans+platform+maven

  • 1.
    Efficient development of large NetBeans Platform applications with Maven Fabrizio Giudici, Senior Java Architect Tidalwave s.a.s - fabrizio.giudici@tidalwave.it Friday, September 24, 2010
  • 2.
    Agenda Efficientdevelopment of large NetBeans Platform applications with Maven 2 Friday, September 24, 2010
  • 3.
    Agenda • Introducing the NetBeans Platform Efficient development of large NetBeans Platform applications with Maven 2 Friday, September 24, 2010
  • 4.
    Agenda • Introducing the NetBeans Platform • The NetBeans Platform Ant Build Harness Efficient development of large NetBeans Platform applications with Maven 2 Friday, September 24, 2010
  • 5.
    Agenda • Introducing the NetBeans Platform • The NetBeans Platform Ant Build Harness • Limitations of the NetBeans Platform Ant Build Harness Efficient development of large NetBeans Platform applications with Maven 2 Friday, September 24, 2010
  • 6.
    Agenda • Introducing the NetBeans Platform • The NetBeans Platform Ant Build Harness • Limitations of the NetBeans Platform Ant Build Harness • Introducing Maven Efficient development of large NetBeans Platform applications with Maven 2 Friday, September 24, 2010
  • 7.
    Agenda • Introducing the NetBeans Platform • The NetBeans Platform Ant Build Harness • Limitations of the NetBeans Platform Ant Build Harness • Introducing Maven • The NetBeans Platform Maven Plugin Efficient development of large NetBeans Platform applications with Maven 2 Friday, September 24, 2010
  • 8.
    Agenda • Introducing the NetBeans Platform • The NetBeans Platform Ant Build Harness • Limitations of the NetBeans Platform Ant Build Harness • Introducing Maven • The NetBeans Platform Maven Plugin • Optimizing NetBeans Platform Maven projects Efficient development of large NetBeans Platform applications with Maven 2 Friday, September 24, 2010
  • 9.
    Agenda • Introducing the NetBeans Platform • The NetBeans Platform Ant Build Harness • Limitations of the NetBeans Platform Ant Build Harness • Introducing Maven • The NetBeans Platform Maven Plugin • Optimizing NetBeans Platform Maven projects • Reuse of third parties’ libraries (NBPWR project, optional) Efficient development of large NetBeans Platform applications with Maven 2 Friday, September 24, 2010
  • 10.
    Agenda • Introducing the NetBeans Platform • The NetBeans Platform Ant Build Harness • Limitations of the NetBeans Platform Ant Build Harness • Introducing Maven • The NetBeans Platform Maven Plugin • Optimizing NetBeans Platform Maven projects • Reuse of third parties’ libraries (NBPWR project, optional) • Conclusions Efficient development of large NetBeans Platform applications with Maven 2 Friday, September 24, 2010
  • 11.
    About the speaker Efficient development of large NetBeans Platform applications with Maven 3 Friday, September 24, 2010
  • 12.
    About the speaker • Senior Software Architect, Mentor, Technical Writer • Fourteen years of Java Experience (JSE, JEE, JME, etc...) • Sun Consultant since 1998, Oracle consultant since 2010 • Author of a number of open source projects • Speaker at JavaOne, Devoxx, Jazoon, JAX Italia and other events • Member of the NetBeans Dream Team • Co-leader of JUG Milano • Java.Net blogger at http://www.java.net/blogs/fabriziogiudici Efficient development of large NetBeans Platform applications with Maven 3 Friday, September 24, 2010
  • 13.
    Ant vs Maven? Efficient development of large NetBeans Platform applications with Maven 4 Friday, September 24, 2010
  • 14.
    Ant vs Maven? • What this presentation is not: Efficient development of large NetBeans Platform applications with Maven 4 Friday, September 24, 2010
  • 15.
    Ant vs Maven? • What this presentation is not: • A “X is better than Y” sermon Efficient development of large NetBeans Platform applications with Maven 4 Friday, September 24, 2010
  • 16.
    Ant vs Maven? • What this presentation is not: • A “X is better than Y” sermon • What this presentation is: Efficient development of large NetBeans Platform applications with Maven 4 Friday, September 24, 2010
  • 17.
    Ant vs Maven? • What this presentation is not: • A “X is better than Y” sermon • What this presentation is: • An analysis of scenarios where Maven may serve better than Ant • An analysis of Maven-based NetBeans Platform projects Efficient development of large NetBeans Platform applications with Maven 4 Friday, September 24, 2010
  • 18.
    Ant vs Maven? • What this presentation is not: • A “X is better than Y” sermon • What this presentation is: • An analysis of scenarios where Maven may serve better than Ant • An analysis of Maven-based NetBeans Platform projects • Some basics about the NetBeans Platform and Maven assumed Efficient development of large NetBeans Platform applications with Maven 4 Friday, September 24, 2010
  • 19.
    Ant vs Maven? • What this presentation is not: • A “X is better than Y” sermon • What this presentation is: • An analysis of scenarios where Maven may serve better than Ant • An analysis of Maven-based NetBeans Platform projects • Some basics about the NetBeans Platform and Maven assumed • Based on the speaker’s experience of four years with Ant & the Platform, then replaced by Maven Efficient development of large NetBeans Platform applications with Maven 4 Friday, September 24, 2010
  • 20.
    Related talks atJavaOne 2010 • S314388: Maven 3.x: The Evolution of Enterprise Java Build Infrastructures • S314711: Building Software with Rich Client Platforms • S313667: Swing OSGi Modular Desktop Application Framework • S314266: The Cutting Edge of Desktop Software: The NetBeans Platform in Practice • S314141: Patterns for Modularity • S313338 Getting More Out of Your Hudson Efficient development of large NetBeans Platform applications with Maven 5 Friday, September 24, 2010
  • 21.
    The NetBeans Platform Efficient development of large NetBeans Platform applications with Maven 6 Friday, September 24, 2010
  • 22.
    The NetBeans Platform • The best framework for Swing desktop applications Efficient development of large NetBeans Platform applications with Maven 6 Friday, September 24, 2010
  • 23.
    The NetBeans Platform • The best framework for Swing desktop applications • Provides “plumbing” for many common tasks Efficient development of large NetBeans Platform applications with Maven 6 Friday, September 24, 2010
  • 24.
    The NetBeans Platform • The best framework for Swing desktop applications • Provides “plumbing” for many common tasks • Modular, plugin-oriented, scalable Efficient development of large NetBeans Platform applications with Maven 6 Friday, September 24, 2010
  • 25.
    The NetBeans Platform • The best framework for Swing desktop applications • Provides “plumbing” for many common tasks • Modular, plugin-oriented, scalable • Since 6.9 provides integration with the OSGi framework Efficient development of large NetBeans Platform applications with Maven 6 Friday, September 24, 2010
  • 26.
    The NetBeans Platform • The best framework for Swing desktop applications • Provides “plumbing” for many common tasks • Modular, plugin-oriented, scalable • Since 6.9 provides integration with the OSGi framework • Used also as the foundation of the Oracle NetBeans IDE Efficient development of large NetBeans Platform applications with Maven 6 Friday, September 24, 2010
  • 27.
    The NetBeans Platform • The best framework for Swing desktop applications • Provides “plumbing” for many common tasks • Modular, plugin-oriented, scalable • Since 6.9 provides integration with the OSGi framework • Used also as the foundation of the Oracle NetBeans IDE • Very popular in all the industrial segments Efficient development of large NetBeans Platform applications with Maven 6 Friday, September 24, 2010
  • 28.
    The NetBeans Platform ... more success stories at http://netbeans.org/features/platform/showcase.html • The best framework for Swing desktop applications • Provides “plumbing” for many common tasks • Modular, plugin-oriented, scalable • Since 6.9 provides integration with the OSGi framework • Used also as the foundation of the Oracle NetBeans IDE • Very popular in all the industrial segments Efficient development of large NetBeans Platform applications with Maven 6 Friday, September 24, 2010
  • 29.
    The Platform AntBuild Harness Efficient development of large NetBeans Platform applications with Maven 7 Friday, September 24, 2010
  • 30.
    The Platform AntBuild Harness • By default, the NetBeans Platform uses Ant Efficient development of large NetBeans Platform applications with Maven 7 Friday, September 24, 2010
  • 31.
    The Platform AntBuild Harness • By default, the NetBeans Platform uses Ant • for building itself (together with the IDE) Efficient development of large NetBeans Platform applications with Maven 7 Friday, September 24, 2010
  • 32.
    The Platform AntBuild Harness • By default, the NetBeans Platform uses Ant • for building itself (together with the IDE) • for building Platform-based applications Efficient development of large NetBeans Platform applications with Maven 7 Friday, September 24, 2010
  • 33.
    The Platform AntBuild Harness • By default, the NetBeans Platform uses Ant • for building itself (together with the IDE) • for building Platform-based applications • NetBeans Platform Ant Build Harness Efficient development of large NetBeans Platform applications with Maven 7 Friday, September 24, 2010
  • 34.
    The Platform AntBuild Harness • By default, the NetBeans Platform uses Ant • for building itself (together with the IDE) • for building Platform-based applications • NetBeans Platform Ant Build Harness • Set of standard Ant scripts, tasks and extensions Efficient development of large NetBeans Platform applications with Maven 7 Friday, September 24, 2010
  • 35.
    The Platform AntBuild Harness • By default, the NetBeans Platform uses Ant • for building itself (together with the IDE) • for building Platform-based applications • NetBeans Platform Ant Build Harness • Set of standard Ant scripts, tasks and extensions • Can be used from the IDE or by the command line Efficient development of large NetBeans Platform applications with Maven 7 Friday, September 24, 2010
  • 36.
    The Platform AntBuild Harness • By default, the NetBeans Platform uses Ant • for building itself (together with the IDE) • for building Platform-based applications • NetBeans Platform Ant Build Harness • Set of standard Ant scripts, tasks and extensions • Can be used from the IDE or by the command line • A minimum preliminary setup is required Efficient development of large NetBeans Platform applications with Maven 7 Friday, September 24, 2010
  • 37.
    The Platform AntBuild Harness • By default, the NetBeans Platform uses Ant • for building itself (together with the IDE) • for building Platform-based applications • NetBeans Platform Ant Build Harness • Set of standard Ant scripts, tasks and extensions • Can be used from the IDE or by the command line • A minimum preliminary setup is required • Very good starting point for beginners Efficient development of large NetBeans Platform applications with Maven 7 Friday, September 24, 2010
  • 38.
    The Platform AntBuild Harness • By default, the NetBeans Platform uses Ant • for building itself (together with the IDE) • for building Platform-based applications • NetBeans Platform Ant Build Harness • Set of standard Ant scripts, tasks and extensions • Can be used from the IDE or by the command line • A minimum preliminary setup is required • Very good starting point for beginners • Many people use it even for complex applications Efficient development of large NetBeans Platform applications with Maven 7 Friday, September 24, 2010
  • 39.
    Using the AntBuild Harness Efficient development of large NetBeans Platform applications with Maven 8 Friday, September 24, 2010
  • 40.
    Using the AntBuild Harness • Two ways of using the harness Efficient development of large NetBeans Platform applications with Maven 8 Friday, September 24, 2010
  • 41.
    Using the AntBuild Harness • Two ways of using the harness • Supplied with the IDE and referred to by the project Efficient development of large NetBeans Platform applications with Maven 8 Friday, September 24, 2010
  • 42.
    Using the AntBuild Harness • Two ways of using the harness • Supplied with the IDE and referred to by the project • Needs a local environment setup to “point” to the IDE installation folder Efficient development of large NetBeans Platform applications with Maven 8 Friday, September 24, 2010
  • 43.
    Using the AntBuild Harness • Two ways of using the harness • Supplied with the IDE and referred to by the project • Needs a local environment setup to “point” to the IDE installation folder • Embedded with the project Efficient development of large NetBeans Platform applications with Maven 8 Friday, September 24, 2010
  • 44.
    Using the AntBuild Harness • Two ways of using the harness • Supplied with the IDE and referred to by the project • Needs a local environment setup to “point” to the IDE installation folder • Embedded with the project • Possible clashes if the used Platform version is different than the NetBeans IDE version Efficient development of large NetBeans Platform applications with Maven 8 Friday, September 24, 2010
  • 45.
    Using the AntBuild Harness • Two ways of using the harness • Supplied with the IDE and referred to by the project • Needs a local environment setup to “point” to the IDE installation folder • Embedded with the project • Possible clashes if the used Platform version is different than the NetBeans IDE version Efficient development of large NetBeans Platform applications with Maven 8 Friday, September 24, 2010
  • 46.
    Using the AntBuild Harness • Two ways of using the harness • Supplied with the IDE and referred to by the project • Needs a local environment setup to “point” to the IDE installation folder • Embedded with the project • Possible clashes if the used Platform version is different than the NetBeans IDE version Key concept: the Ant build harness is a specific build system for the Platform projects Efficient development of large NetBeans Platform applications with Maven 8 Friday, September 24, 2010
  • 47.
    When Ant mightnot scale Efficient development of large NetBeans Platform applications with Maven 9 Friday, September 24, 2010
  • 48.
    When Ant mightnot scale • With a large number of modules Efficient development of large NetBeans Platform applications with Maven 9 Friday, September 24, 2010
  • 49.
    When Ant mightnot scale • With a large number of modules • Good design practices lead to many small packages Efficient development of large NetBeans Platform applications with Maven 9 Friday, September 24, 2010
  • 50.
    When Ant mightnot scale • With a large number of modules • Good design practices lead to many small packages • With multiple projects with many inter-dependencies Efficient development of large NetBeans Platform applications with Maven 9 Friday, September 24, 2010
  • 51.
    When Ant mightnot scale • With a large number of modules • Good design practices lead to many small packages • With multiple projects with many inter-dependencies In other words: how to reuse modules? Efficient development of large NetBeans Platform applications with Maven 9 Friday, September 24, 2010
  • 52.
    When Ant mightnot scale • With a large number of modules • Good design practices lead to many small packages • With multiple projects with many inter-dependencies In other words: how to reuse modules? • Might be a single project that’s worth while splitting Efficient development of large NetBeans Platform applications with Maven 9 Friday, September 24, 2010
  • 53.
    When Ant mightnot scale • With a large number of modules • Good design practices lead to many small packages • With multiple projects with many inter-dependencies In other words: how to reuse modules? • Might be a single project that’s worth while splitting • What’s a module of the NetBeans Platform, BTW? Efficient development of large NetBeans Platform applications with Maven 9 Friday, September 24, 2010
  • 54.
    When Ant mightnot scale • With a large number of modules • Good design practices lead to many small packages • With multiple projects with many inter-dependencies In other words: how to reuse modules? • Might be a single project that’s worth while splitting • What’s a module of the NetBeans Platform, BTW? • A collection of cohese packages exposing an API Efficient development of large NetBeans Platform applications with Maven 9 Friday, September 24, 2010
  • 55.
    When Ant mightnot scale • With a large number of modules • Good design practices lead to many small packages • With multiple projects with many inter-dependencies In other words: how to reuse modules? • Might be a single project that’s worth while splitting • What’s a module of the NetBeans Platform, BTW? • A collection of cohese packages exposing an API • Packed in .nbm files (.jar + metadata) Efficient development of large NetBeans Platform applications with Maven 9 Friday, September 24, 2010
  • 56.
    When Ant mightnot scale Only a subset of dependencies shown OpenBlueSky • With a large number blueMarine blueMarine of modules blueMarine blueMarine Metadata Semantic Media PDF • Good design practices lead to many small packages blueMarine blueMarine blueMarine blueMarine • Core Catalog Gallery LightTable With multiple projects with many inter-dependencies In other words: how to reuse modules? forceTen • Might be a single project that’s worth while splitting blueMarine Geo • What’s a module of the NetBeans Platform, BTW? blueMarine • A collection of cohese packages exposing an API • Packed in .nbm files (.jar + metadata) for blueOcean blueBill Server blueBill Android Efficient development of large NetBeans Platform applications with Maven 9 Friday, September 24, 2010
  • 57.
    When Ant mightnot scale • With a large number of modules • Good design practices lead to many small packages • With multiple projects with many inter-dependencies In other words: how to reuse modules? • Might be a single project that’s worth while splitting • What’s a module of the NetBeans Platform, BTW? • A collection of cohese packages exposing an API • Packed in .nbm files (.jar + metadata) Efficient development of large NetBeans Platform applications with Maven 9 Friday, September 24, 2010
  • 58.
    Pushing the AntBuild: Suite Chaining Slide in a graph showing a dependency graph: Suite --> Platform Efficient development of large NetBeans Platform applications with Maven 10 Friday, September 24, 2010
  • 59.
    Pushing the AntBuild: Suite Chaining • Platform: a self-contained set of .nbm modules Slide in a graph showing a dependency graph: Suite --> Platform Efficient development of large NetBeans Platform applications with Maven 10 Friday, September 24, 2010
  • 60.
    Pushing the AntBuild: Suite Chaining • Platform: a self-contained set of .nbm modules • The NetBeans Platform is obviously one example of a platform Slide in a graph showing a dependency graph: Suite --> Platform Efficient development of large NetBeans Platform applications with Maven 10 Friday, September 24, 2010
  • 61.
    Pushing the AntBuild: Suite Chaining • Platform: a self-contained set of .nbm modules • The NetBeans Platform is obviously one example of a platform • Module Suite: a set of .nbm modules depending on a Platform Slide in a graph showing a dependency graph: Suite --> Platform Efficient development of large NetBeans Platform applications with Maven 10 Friday, September 24, 2010
  • 62.
    Pushing the AntBuild: Suite Chaining • Platform: a self-contained set of .nbm modules • The NetBeans Platform is obviously one example of a platform • Module Suite: a set of .nbm modules depending on a Platform • Any NetBeans Platform-based project is a suite Slide in a graph showing a dependency graph: Suite --> Platform Efficient development of large NetBeans Platform applications with Maven 10 Friday, September 24, 2010
  • 63.
    Pushing the AntBuild: Suite Chaining • Platform: a self-contained set of .nbm modules • The NetBeans Platform is obviously one example of a platform • Module Suite: a set of .nbm modules depending on a Platform • Any NetBeans Platform-based project is a suite • It is possible to have a Suite depending on a Platform + another Suite (“Suite Chaining”) Slide in a graph showing a dependency graph: Suite --> Platform Efficient development of large NetBeans Platform applications with Maven 10 Friday, September 24, 2010
  • 64.
    Pushing the AntBuild: Suite Chaining • Platform: a self-contained set of .nbm modules • The NetBeans Platform is obviously one example of a platform • Module Suite: a set of .nbm modules depending on a Platform • Any NetBeans Platform-based project is a suite • It is possible to have a Suite depending on a Platform + another Suite (“Suite Chaining”) Slide in a graph showing a dependency graph: Suite --> Platform • Doable, but cumbersome Efficient development of large NetBeans Platform applications with Maven 10 Friday, September 24, 2010
  • 65.
    Pushing the AntBuild: Suite Chaining • Platform: a self-contained set of .nbm modules • The NetBeans Platform is obviously one example of a platform • Module Suite: a set of .nbm modules depending on a Platform • Any NetBeans Platform-based project is a suite • It is possible to have a Suite depending on a Platform + another Suite (“Suite Chaining”) Slide in a graph showing a dependency graph: Suite --> Platform • Doable, but cumbersome • Doesn’t scale well with multiple suite levels Efficient development of large NetBeans Platform applications with Maven 10 Friday, September 24, 2010
  • 66.
    Reusing modules withthe Ant build harness Efficient development of large NetBeans Platform applications with Maven 11 Friday, September 24, 2010
  • 67.
    Reusing modules withthe Ant build harness • It’s possible to create a custom platform, assembling arbitrary .nbm modules Efficient development of large NetBeans Platform applications with Maven 11 Friday, September 24, 2010
  • 68.
    Reusing modules withthe Ant build harness • It’s possible to create a custom platform, assembling arbitrary .nbm modules • Of course, dependencies must be satisfied Efficient development of large NetBeans Platform applications with Maven 11 Friday, September 24, 2010
  • 69.
    Reusing modules withthe Ant build harness • It’s possible to create a custom platform, assembling arbitrary .nbm modules • Of course, dependencies must be satisfied • You can assemble a Platform feeding the .nbm artifacts from a project to another project Efficient development of large NetBeans Platform applications with Maven 11 Friday, September 24, 2010
  • 70.
    Reusing modules withthe Ant build harness • It’s possible to create a custom platform, assembling arbitrary .nbm modules • Of course, dependencies must be satisfied • You can assemble a Platform feeding the .nbm artifacts from a project to another project • This approach (apparently) scales well beyond the first level Efficient development of large NetBeans Platform applications with Maven 11 Friday, September 24, 2010
  • 71.
    Reusing modules withthe Ant build harness • It’s possible to create a custom platform, assembling arbitrary .nbm modules • Of course, dependencies must be satisfied • You can assemble a Platform feeding the .nbm artifacts from a project to another project • This approach (apparently) scales well beyond the first level • http://weblogs.java.net/blog/2007/11/03/netbeans-rcp-beyond-suite-chaining Efficient development of large NetBeans Platform applications with Maven 11 Friday, September 24, 2010
  • 72.
    Reusing modules withthe Ant build harness • It’s possible to create a custom platform, assembling arbitrary .nbm modules • Of course, dependencies must be satisfied • You can assemble a Platform feeding the .nbm artifacts from a project to another project • This approach (apparently) scales well beyond the first level • http://weblogs.java.net/blog/2007/11/03/netbeans-rcp-beyond-suite-chaining • NetBeans 6.7 introduced support for reusing modules Efficient development of large NetBeans Platform applications with Maven 11 Friday, September 24, 2010
  • 73.
    Reusing modules withthe Ant build harness • It’s possible to create a custom platform, assembling arbitrary .nbm modules • Of course, dependencies must be satisfied • You can assemble a Platform feeding the .nbm artifacts from a project to another project • This approach (apparently) scales well beyond the first level • http://weblogs.java.net/blog/2007/11/03/netbeans-rcp-beyond-suite-chaining • NetBeans 6.7 introduced support for reusing modules • http://wiki.netbeans.org/DevFaqHowToReuseModules Efficient development of large NetBeans Platform applications with Maven 11 Friday, September 24, 2010
  • 74.
    Reusing modules withthe Ant build harness • It’s possible to create a custom platform, assembling arbitrary .nbm modules • Of course, dependencies must be satisfied • You can assemble a Platform feeding the .nbm artifacts from a project to another project • This approach (apparently) scales well beyond the first level • http://weblogs.java.net/blog/2007/11/03/netbeans-rcp-beyond-suite-chaining • NetBeans 6.7 introduced support for reusing modules • http://wiki.netbeans.org/DevFaqHowToReuseModules Efficient development of large NetBeans Platform applications with Maven 11 Friday, September 24, 2010
  • 75.
    Reusing modules withthe Ant build harness • It’s possible to create a custom platform, assembling arbitrary .nbm modules • Of course, dependencies must be satisfied • You can assemble a Platform feeding the .nbm artifacts from a project to another project • This approach (apparently) scales well beyond the first level • http://weblogs.java.net/blog/2007/11/03/netbeans-rcp-beyond-suite-chaining • NetBeans 6.7 introduced support for reusing modules • http://wiki.netbeans.org/DevFaqHowToReuseModules Efficient development of large NetBeans Platform applications with Maven 11 Friday, September 24, 2010
  • 76.
    Limits of CustomPlatforms with Ant Efficient development of large NetBeans Platform applications with Maven 12 Friday, September 24, 2010
  • 77.
    Limits of CustomPlatforms with Ant • Conceptually simple, the cumbersome part is automating the “feed” of NBM artifacts from a project to another Efficient development of large NetBeans Platform applications with Maven 12 Friday, September 24, 2010
  • 78.
    Limits of CustomPlatforms with Ant • Conceptually simple, the cumbersome part is automating the “feed” of NBM artifacts from a project to another • Personal experience Efficient development of large NetBeans Platform applications with Maven 12 Friday, September 24, 2010
  • 79.
    Limits of CustomPlatforms with Ant • Conceptually simple, the cumbersome part is automating the “feed” of NBM artifacts from a project to another • Personal experience • Wrote a couple of custom Ant tasks to enhance the original harness with artifact management facilities Efficient development of large NetBeans Platform applications with Maven 12 Friday, September 24, 2010
  • 80.
    Limits of CustomPlatforms with Ant • Conceptually simple, the cumbersome part is automating the “feed” of NBM artifacts from a project to another • Personal experience • Wrote a couple of custom Ant tasks to enhance the original harness with artifact management facilities • Reached some high complexity when trying to share javadocs and sources too Efficient development of large NetBeans Platform applications with Maven 12 Friday, September 24, 2010
  • 81.
    Limits of CustomPlatforms with Ant • Conceptually simple, the cumbersome part is automating the “feed” of NBM artifacts from a project to another • Personal experience • Wrote a couple of custom Ant tasks to enhance the original harness with artifact management facilities • Reached some high complexity when trying to share javadocs and sources too • Sources in particular are important, e.g. for profiling etc... Efficient development of large NetBeans Platform applications with Maven 12 Friday, September 24, 2010
  • 82.
    Limits of CustomPlatforms with Ant • Conceptually simple, the cumbersome part is automating the “feed” of NBM artifacts from a project to another • Personal experience • Wrote a couple of custom Ant tasks to enhance the original harness with artifact management facilities • Reached some high complexity when trying to share javadocs and sources too • Sources in particular are important, e.g. for profiling etc... • At this point I moved to Maven... Efficient development of large NetBeans Platform applications with Maven 12 Friday, September 24, 2010
  • 83.
    Limits of CustomPlatforms with Ant • Conceptually simple, the cumbersome part is automating the “feed” of NBM artifacts from a project to another • Personal experience • Wrote a couple of custom Ant tasks to enhance the original harness with artifact management facilities • Reached some high complexity when trying to share javadocs and sources too • Sources in particular are important, e.g. for profiling etc... • At this point I moved to Maven... • I’m recommending to customers - of course your mileage may vary Efficient development of large NetBeans Platform applications with Maven 12 Friday, September 24, 2010
  • 84.
    Introducing Maven Efficient development of large NetBeans Platform applications with Maven 13 Friday, September 24, 2010
  • 85.
    Introducing Maven • A different building tool than Ant Efficient development of large NetBeans Platform applications with Maven 13 Friday, September 24, 2010
  • 86.
    Introducing Maven • A different building tool than Ant • Standard lifecycle (= sequence of phases) applied to projects Efficient development of large NetBeans Platform applications with Maven 13 Friday, September 24, 2010
  • 87.
    Introducing Maven • A different building tool than Ant • Standard lifecycle (= sequence of phases) applied to projects • Projects are described by a POM (Project Object Model) Efficient development of large NetBeans Platform applications with Maven 13 Friday, September 24, 2010
  • 88.
    Introducing Maven • A different building tool than Ant • Standard lifecycle (= sequence of phases) applied to projects • Projects are described by a POM (Project Object Model) • Composed of plugins attaching goals to phases Efficient development of large NetBeans Platform applications with Maven 13 Friday, September 24, 2010
  • 89.
    Introducing Maven • A different building tool than Ant • Standard lifecycle (= sequence of phases) applied to projects • Projects are described by a POM (Project Object Model) • Composed of plugins attaching goals to phases • Provides efficient artifact management with repositories Efficient development of large NetBeans Platform applications with Maven 13 Friday, September 24, 2010
  • 90.
    Introducing Maven • A different building tool than Ant • Standard lifecycle (= sequence of phases) applied to projects • Projects are described by a POM (Project Object Model) • Composed of plugins attaching goals to phases • Provides efficient artifact management with repositories • more info later Efficient development of large NetBeans Platform applications with Maven 13 Friday, September 24, 2010
  • 91.
    Introducing Maven • A different building tool than Ant • Standard lifecycle (= sequence of phases) applied to projects • Projects are described by a POM (Project Object Model) • Composed of plugins attaching goals to phases • Provides efficient artifact management with repositories • more info later Ant: interpreter to create build scripts Efficient development of large NetBeans Platform applications with Maven 13 Friday, September 24, 2010
  • 92.
    Introducing Maven • A different building tool than Ant • Standard lifecycle (= sequence of phases) applied to projects • Projects are described by a POM (Project Object Model) • Composed of plugins attaching goals to phases • Provides efficient artifact management with repositories • more info later Ant: interpreter Maven: standard, well defined to create build scripts build system that can be customized Efficient development of large NetBeans Platform applications with Maven 13 Friday, September 24, 2010
  • 93.
    Introducing Maven • A different building tool than Ant • Standard lifecycle (= sequence of phases) applied to projects • Projects are described by a POM (Project Object Model) • Composed of plugins attaching goals to phases • Provides efficient artifact management with repositories • more info later Ant: interpreter Maven: standard, well defined to create build scripts build system that can be customized Programmatic Efficient development of large NetBeans Platform applications with Maven 13 Friday, September 24, 2010
  • 94.
    Introducing Maven • A different building tool than Ant • Standard lifecycle (= sequence of phases) applied to projects • Projects are described by a POM (Project Object Model) • Composed of plugins attaching goals to phases • Provides efficient artifact management with repositories • more info later Ant: interpreter Maven: standard, well defined to create build scripts build system that can be customized Programmatic Declarative Efficient development of large NetBeans Platform applications with Maven 13 Friday, September 24, 2010
  • 95.
    Inheritance and composition Efficient development of large NetBeans Platform applications with Maven 14 Friday, September 24, 2010
  • 96.
    Inheritance and composition • “Object model” means it implies some typical OO practices Efficient development of large NetBeans Platform applications with Maven 14 Friday, September 24, 2010
  • 97.
    Inheritance and composition • “Object model” means it implies some typical OO practices • Inheritance Efficient development of large NetBeans Platform applications with Maven 14 Friday, September 24, 2010
  • 98.
    Inheritance and composition • “Object model” means it implies some typical OO practices • Inheritance • A module POM can inherit from a parent POM Efficient development of large NetBeans Platform applications with Maven 14 Friday, September 24, 2010
  • 99.
    Inheritance and composition • “Object model” means it implies some typical OO practices • Inheritance • A module POM can inherit from a parent POM • Composition Efficient development of large NetBeans Platform applications with Maven 14 Friday, September 24, 2010
  • 100.
    Inheritance and composition • “Object model” means it implies some typical OO practices • Inheritance • A module POM can inherit from a parent POM • Composition • A module POM can import parts of other modules POM Efficient development of large NetBeans Platform applications with Maven 14 Friday, September 24, 2010
  • 101.
    Inheritance and composition • “Object model” means it implies some typical OO practices • Inheritance • A module POM can inherit from a parent POM • Composition • A module POM can import parts of other modules POM • Both practices reduces entropy (DRY) Efficient development of large NetBeans Platform applications with Maven 14 Friday, September 24, 2010
  • 102.
    Inheritance and composition • “Object model” means it implies some typical OO practices • Inheritance • A module POM can inherit from a parent POM • Composition • A module POM can import parts of other modules POM • Both practices reduces entropy (DRY) • Still verbose because of XML (but it’s syntax, not semantics) Efficient development of large NetBeans Platform applications with Maven 14 Friday, September 24, 2010
  • 103.
    Inheritance and composition • “Object model” means it implies some typical OO practices • Inheritance • A module POM can inherit from a parent POM • Composition • A module POM can import parts of other modules POM • Both practices reduces entropy (DRY) • Still verbose because of XML (but it’s syntax, not semantics) • Maven 3 allows for more compact syntaxes (e.g. Groovy) Efficient development of large NetBeans Platform applications with Maven 14 Friday, September 24, 2010
  • 104.
    Artifacts, dependencies, repositories Efficient development of large NetBeans Platform applications with Maven 15 Friday, September 24, 2010
  • 105.
    Artifacts, dependencies, repositories • Each module Efficient development of large NetBeans Platform applications with Maven 15 Friday, September 24, 2010
  • 106.
    Artifacts, dependencies, repositories • Each module • Possibly depends on other modules artifacts Efficient development of large NetBeans Platform applications with Maven 15 Friday, September 24, 2010
  • 107.
    Artifacts, dependencies, repositories • Each module • Possibly depends on other modules artifacts • Produces a single artifact (which might consist in multiple files) Efficient development of large NetBeans Platform applications with Maven 15 Friday, September 24, 2010
  • 108.
    Artifacts, dependencies, repositories • Each module • Possibly depends on other modules artifacts • Produces a single artifact (which might consist in multiple files) • Each artifact Efficient development of large NetBeans Platform applications with Maven 15 Friday, September 24, 2010
  • 109.
    Artifacts, dependencies, repositories • Each module • Possibly depends on other modules artifacts • Produces a single artifact (which might consist in multiple files) • Each artifact • Has got unique coordinates: groupId, artifactId, version, packaging, classifier Efficient development of large NetBeans Platform applications with Maven 15 Friday, September 24, 2010
  • 110.
    Artifacts, dependencies, repositories • Each module • Possibly depends on other modules artifacts • Produces a single artifact (which might consist in multiple files) • Each artifact • Has got unique coordinates: groupId, artifactId, version, packaging, classifier • Can be retrieved from a local / remote repository Efficient development of large NetBeans Platform applications with Maven 15 Friday, September 24, 2010
  • 111.
    Artifacts, dependencies, repositories • Each module • Possibly depends on other modules artifacts • Produces a single artifact (which might consist in multiple files) • Each artifact • Has got unique coordinates: groupId, artifactId, version, packaging, classifier • Can be retrieved from a local / remote repository • Can be published to a local / remote repository Efficient development of large NetBeans Platform applications with Maven 15 Friday, September 24, 2010
  • 112.
    The NBM MavenPlugin Efficient development of large NetBeans Platform applications with Maven 16 Friday, September 24, 2010
  • 113.
    The NBM MavenPlugin • A specific Maven plugin for the NetBeans Platform Efficient development of large NetBeans Platform applications with Maven 16 Friday, September 24, 2010
  • 114.
    The NBM MavenPlugin • A specific Maven plugin for the NetBeans Platform • Defines the ‘nbm’ packaging Efficient development of large NetBeans Platform applications with Maven 16 Friday, September 24, 2010
  • 115.
    The NBM MavenPlugin • A specific Maven plugin for the NetBeans Platform • Defines the ‘nbm’ packaging • Creates nbm artifacts Efficient development of large NetBeans Platform applications with Maven 16 Friday, September 24, 2010
  • 116.
    The NBM MavenPlugin • A specific Maven plugin for the NetBeans Platform • Defines the ‘nbm’ packaging • Creates nbm artifacts • Manages branding Efficient development of large NetBeans Platform applications with Maven 16 Friday, September 24, 2010
  • 117.
    The NBM MavenPlugin • A specific Maven plugin for the NetBeans Platform • Defines the ‘nbm’ packaging • Creates nbm artifacts • Manages branding • Creates .zip and JNLP distributions Efficient development of large NetBeans Platform applications with Maven 16 Friday, September 24, 2010
  • 118.
    The NBM MavenPlugin • A specific Maven plugin for the NetBeans Platform • Defines the ‘nbm’ packaging • Creates nbm artifacts • Manages branding • Creates .zip and JNLP distributions • Properly runs the project being developed Efficient development of large NetBeans Platform applications with Maven 16 Friday, September 24, 2010
  • 119.
    The NBM MavenPlugin • A specific Maven plugin for the NetBeans Platform • Defines the ‘nbm’ packaging • Creates nbm artifacts • Manages branding • Creates .zip and JNLP distributions • Properly runs the project being developed • Out-of-the-box support by the IDE, better integration with 6.9 Efficient development of large NetBeans Platform applications with Maven 16 Friday, September 24, 2010
  • 120.
    Further benefits If you have time, demonstrate e.g. FindBugs integration. In any case, connect to the Tidalwave Hudson instance and show some stuff Efficient development of large NetBeans Platform applications with Maven 17 Friday, September 24, 2010
  • 121.
    Further benefits If you have time, demonstrate e.g. FindBugs integration. In any case, connect to the Tidalwave Hudson instance and show some stuff • Your project becomes just a standard Maven project Efficient development of large NetBeans Platform applications with Maven 17 Friday, September 24, 2010
  • 122.
    Further benefits If you have time, demonstrate e.g. FindBugs integration. In any case, connect to the Tidalwave Hudson instance and show some stuff No more NetBeans specific “build harness” • Your project becomes just a standard Maven project Efficient development of large NetBeans Platform applications with Maven 17 Friday, September 24, 2010
  • 123.
    Further benefits If you have time, demonstrate e.g. FindBugs integration. In any case, connect to the Tidalwave Hudson instance and show some stuff No more NetBeans specific “build harness” • Your project becomes just a standard Maven project • No special build instructions: mvn clean install Efficient development of large NetBeans Platform applications with Maven 17 Friday, September 24, 2010
  • 124.
    Further benefits If you have time, demonstrate e.g. FindBugs integration. In any case, connect to the Tidalwave Hudson instance and show some stuff No more NetBeans specific “build harness” • Your project becomes just a standard Maven project • No special build instructions: mvn clean install • IDE - neutral (IDEA, Eclipse) Efficient development of large NetBeans Platform applications with Maven 17 Friday, September 24, 2010
  • 125.
    Further benefits If you have time, demonstrate e.g. FindBugs integration. In any case, connect to the Tidalwave Hudson instance and show some stuff No more NetBeans specific “build harness” • Your project becomes just a standard Maven project • No special build instructions: mvn clean install • IDE - neutral (IDEA, Eclipse) • Immediately available for CI without any specific setup Efficient development of large NetBeans Platform applications with Maven 17 Friday, September 24, 2010
  • 126.
    Further benefits If you have time, demonstrate e.g. FindBugs integration. In any case, connect to the Tidalwave Hudson instance and show some stuff No more NetBeans specific “build harness” • Your project becomes just a standard Maven project • No special build instructions: mvn clean install • IDE - neutral (IDEA, Eclipse) • Immediately available for CI without any specific setup • Easy to augment with QA plugins (e.g. Cobertura, FindBugs) Efficient development of large NetBeans Platform applications with Maven 17 Friday, September 24, 2010
  • 127.
    Further benefits If you have time, demonstrate e.g. FindBugs integration. In any case, connect to the Tidalwave Hudson instance and show some stuff No more NetBeans specific “build harness” • Your project becomes just a standard Maven project • No special build instructions: mvn clean install • IDE - neutral (IDEA, Eclipse) • Immediately available for CI without any specific setup • Easy to augment with QA plugins (e.g. Cobertura, FindBugs) • Just configure the plugin in the Master POM Efficient development of large NetBeans Platform applications with Maven 17 Friday, September 24, 2010
  • 128.
    Further benefits If you have time, demonstrate e.g. FindBugs integration. In any case, connect to the Tidalwave Hudson instance and show some stuff No more NetBeans specific “build harness” • Your project becomes just a standard Maven project • No special build instructions: mvn clean install • IDE - neutral (IDEA, Eclipse) • Immediately available for CI without any specific setup • Easy to augment with QA plugins (e.g. Cobertura, FindBugs) • Just configure the plugin in the Master POM • Run it (e.g. mvn findbugs:findbugs) Efficient development of large NetBeans Platform applications with Maven 17 Friday, September 24, 2010
  • 129.
    Project structure Efficient development of large NetBeans Platform applications with Maven 18 Friday, September 24, 2010
  • 130.
    Project structure • Modules Master POM • Master POM • Application module 1 Branding Module POM • What and how to assemble as final app 1 • Branding module Application Module POM • e.g. i18n resources, customization of existing platform resources * Other NBM POM • One or more .nbm modules Efficient development of large NetBeans Platform applications with Maven 18 Friday, September 24, 2010
  • 131.
    Demo Efficientdevelopment of large NetBeans Platform applications with Maven 19 Friday, September 24, 2010
  • 132.
    Demo • Show forceTen Example 1 Efficient development of large NetBeans Platform applications with Maven 19 Friday, September 24, 2010
  • 133.
    Dependency caveat! Efficient development of large NetBeans Platform applications with Maven 20 Friday, September 24, 2010
  • 134.
    Dependency caveat! • Maven dependencies are transitive Efficient development of large NetBeans Platform applications with Maven 20 Friday, September 24, 2010
  • 135.
    Dependency caveat! • Maven dependencies are transitive • NetBeans Platform dependencies are not transitive Efficient development of large NetBeans Platform applications with Maven 20 Friday, September 24, 2010
  • 136.
    Dependency caveat! • Maven dependencies are transitive • NetBeans Platform dependencies are not transitive • The Maven plugin: Efficient development of large NetBeans Platform applications with Maven 20 Friday, September 24, 2010
  • 137.
    Dependency caveat! • Maven dependencies are transitive • NetBeans Platform dependencies are not transitive • The Maven plugin: • automatically translates direct Maven dependencies on NBM modules to Platform dependencies Efficient development of large NetBeans Platform applications with Maven 20 Friday, September 24, 2010
  • 138.
    Dependency caveat! • Maven dependencies are transitive • NetBeans Platform dependencies are not transitive • The Maven plugin: • automatically translates direct Maven dependencies on NBM modules to Platform dependencies • performs a consistency check about missing transitive dependencies and dependencies on non-public classes Efficient development of large NetBeans Platform applications with Maven 20 Friday, September 24, 2010
  • 139.
    Dependency caveat! • Maven dependencies are transitive • NetBeans Platform dependencies are not transitive • The Maven plugin: • automatically translates direct Maven dependencies on NBM modules to Platform dependencies • performs a consistency check about missing transitive dependencies and dependencies on non-public classes • OSGi bundles allowed as dependencies since IDE 6.9 + NBM plugin 3.2 Efficient development of large NetBeans Platform applications with Maven 20 Friday, September 24, 2010
  • 140.
    Dependency caveat! • Maven dependencies are transitive • NetBeans Platform dependencies are not transitive • The Maven plugin: • automatically translates direct Maven dependencies on NBM modules to Platform dependencies • performs a consistency check about missing transitive dependencies and dependencies on non-public classes • OSGi bundles allowed as dependencies since IDE 6.9 + NBM plugin 3.2 • Old versions of the plugin behaved in a different way Efficient development of large NetBeans Platform applications with Maven 20 Friday, September 24, 2010
  • 141.
    Dependency caveat! • Maven dependencies are transitive • NetBeans Platform dependencies are not transitive • The Maven plugin: • automatically translates direct Maven dependencies on NBM modules to Platform dependencies • performs a consistency check about missing transitive dependencies and dependencies on non-public classes • OSGi bundles allowed as dependencies since IDE 6.9 + NBM plugin 3.2 • Old versions of the plugin behaved in a different way • Not mentioning some deprecated practices still available in 3.x Efficient development of large NetBeans Platform applications with Maven 20 Friday, September 24, 2010
  • 142.
    Reuse of NBMmodules in non-platform projects Efficient development of large NetBeans Platform applications with Maven 21 Friday, September 24, 2010
  • 143.
    Reuse of NBMmodules in non-platform projects • The NBM Maven plugin produces both a .nbm and a .jar artifacts (different packagings) Efficient development of large NetBeans Platform applications with Maven 21 Friday, September 24, 2010
  • 144.
    Reuse of NBMmodules in non-platform projects • The NBM Maven plugin produces both a .nbm and a .jar artifacts (different packagings) • This means that a non-platform project can reuse a NBM module Efficient development of large NetBeans Platform applications with Maven 21 Friday, September 24, 2010
  • 145.
    Reuse of NBMmodules in non-platform projects • The NBM Maven plugin produces both a .nbm and a .jar artifacts (different packagings) • This means that a non-platform project can reuse a NBM module • E.g. Java SE, Android, etc... Efficient development of large NetBeans Platform applications with Maven 21 Friday, September 24, 2010
  • 146.
    Reuse of NBMmodules in non-platform projects • The NBM Maven plugin produces both a .nbm and a .jar artifacts (different packagings) • This means that a non-platform project can reuse a NBM module • E.g. Java SE, Android, etc... • Just declare a dependency as usual Efficient development of large NetBeans Platform applications with Maven 21 Friday, September 24, 2010
  • 147.
    Reuse of NBMmodules in non-platform projects • The NBM Maven plugin produces both a .nbm and a .jar artifacts (different packagings) • This means that a non-platform project can reuse a NBM module • E.g. Java SE, Android, etc... • Just declare a dependency as usual • Projects whose packaging is nbm automatically depend on nbm artifacts Efficient development of large NetBeans Platform applications with Maven 21 Friday, September 24, 2010
  • 148.
    Reuse of NBMmodules in non-platform projects • The NBM Maven plugin produces both a .nbm and a .jar artifacts (different packagings) • This means that a non-platform project can reuse a NBM module • E.g. Java SE, Android, etc... • Just declare a dependency as usual • Projects whose packaging is nbm automatically depend on nbm artifacts • Projects whose packaging is jar automatically depend on jar artifacts Efficient development of large NetBeans Platform applications with Maven 21 Friday, September 24, 2010
  • 149.
    Demo • Show forceTen Example 2 Efficient development of large NetBeans Platform applications with Maven 22 Friday, September 24, 2010
  • 150.
    Module versioning strategies Efficient development of large NetBeans Platform applications with Maven 23 Friday, September 24, 2010
  • 151.
    Module versioning strategies • Every module artifact shares the same version of the project Efficient development of large NetBeans Platform applications with Maven 23 Friday, September 24, 2010
  • 152.
    Module versioning strategies • Every module artifact shares the same version of the project • Simpler to manage Efficient development of large NetBeans Platform applications with Maven 23 Friday, September 24, 2010
  • 153.
    Module versioning strategies • Every module artifact shares the same version of the project • Simpler to manage • Used by NetBeans for publishing Maven artifacts (e.g. NETBEANS691) Efficient development of large NetBeans Platform applications with Maven 23 Friday, September 24, 2010
  • 154.
    Module versioning strategies • Every module artifact shares the same version of the project • Simpler to manage • Used by NetBeans for publishing Maven artifacts (e.g. NETBEANS691) • Trick - indeed every NetBeans module has got its own version Efficient development of large NetBeans Platform applications with Maven 23 Friday, September 24, 2010
  • 155.
    Module versioning strategies • Every module artifact shares the same version of the project • Simpler to manage • Used by NetBeans for publishing Maven artifacts (e.g. NETBEANS691) • Trick - indeed every NetBeans module has got its own version • Every module artifact has got its own version number Efficient development of large NetBeans Platform applications with Maven 23 Friday, September 24, 2010
  • 156.
    Module versioning strategies • Every module artifact shares the same version of the project • Simpler to manage • Used by NetBeans for publishing Maven artifacts (e.g. NETBEANS691) • Trick - indeed every NetBeans module has got its own version • Every module artifact has got its own version number • Slightly more complex to manage Efficient development of large NetBeans Platform applications with Maven 23 Friday, September 24, 2010
  • 157.
    Module versioning strategies • Every module artifact shares the same version of the project • Simpler to manage • Used by NetBeans for publishing Maven artifacts (e.g. NETBEANS691) • Trick - indeed every NetBeans module has got its own version • Every module artifact has got its own version number • Slightly more complex to manage • Required if your modules might move from a project to another Efficient development of large NetBeans Platform applications with Maven 23 Friday, September 24, 2010
  • 158.
    Smart dependency convergence Efficient development of large NetBeans Platform applications with Maven 24 Friday, September 24, 2010
  • 159.
    Smart dependency convergence • The <dependencyManagement> section Efficient development of large NetBeans Platform applications with Maven 24 Friday, September 24, 2010
  • 160.
    Smart dependency convergence • The <dependencyManagement> section • Declare all the versions of the dependencies used in a project just once, in a parent POM (DRY) Efficient development of large NetBeans Platform applications with Maven 24 Friday, September 24, 2010
  • 161.
    Smart dependency convergence • The <dependencyManagement> section • Declare all the versions of the dependencies used in a project just once, in a parent POM (DRY) • Children POMs won’t need to declare the version again Efficient development of large NetBeans Platform applications with Maven 24 Friday, September 24, 2010
  • 162.
    <dependencyManagement> Smart dependency convergence <dependencies> <dependency> <groupId>it.tidalwave.netbeans</groupId> <artifactId>it-tidalwave-netbeans-capabilitiesprovider</artifactId> <version>1.1.26</version> </dependency> <dependency> <groupId>it.tidalwave.netbeans</groupId> <artifactId>it-tidalwave-netbeans-docking</artifactId> <version>1.1.14</version> • The <dependencyManagement> section </dependency> ... </dependencies> • </dependencyManagement> Declare all the versions of the dependencies used in a project just once, in a parent POM (DRY) • Children POMs won’t need to declare the version again Efficient development of large NetBeans Platform applications with Maven 24 Friday, September 24, 2010
  • 163.
    <dependencyManagement> Smart dependency convergence <dependencies> <dependency> <groupId>it.tidalwave.netbeans</groupId> <artifactId>it-tidalwave-netbeans-capabilitiesprovider</artifactId> <version>1.1.26</version> </dependency> <dependency> <groupId>it.tidalwave.netbeans</groupId> <artifactId>it-tidalwave-netbeans-docking</artifactId> <version>1.1.14</version> • The <dependencyManagement> section </dependency> ... </dependencies> • </dependencyManagement> Declare all the versions of the dependencies used in a project just once, in a parent POM (DRY) • Children POMs won’t need to declare the version again • The <dependencyManagement> section can be imported Efficient development of large NetBeans Platform applications with Maven 24 Friday, September 24, 2010
  • 164.
    <dependencyManagement> Smart dependency convergence <dependencies> <dependency> <groupId>it.tidalwave.netbeans</groupId> <artifactId>it-tidalwave-netbeans-capabilitiesprovider</artifactId> <version>1.1.26</version> </dependency> <dependency> <groupId>it.tidalwave.netbeans</groupId> <artifactId>it-tidalwave-netbeans-docking</artifactId> <version>1.1.14</version> • The <dependencyManagement> section </dependency> ... </dependencies> • </dependencyManagement> Declare all the versions of the dependencies used in a project just once, in a parent POM (DRY) • Children POMs won’t need to declare the version again • The <dependencyManagement> section can be imported • Import a single POM specifying its single version Efficient development of large NetBeans Platform applications with Maven 24 Friday, September 24, 2010
  • 165.
    <dependencyManagement> Smart dependency convergence <dependencies> <dependency> <groupId>it.tidalwave.netbeans</groupId> <artifactId>it-tidalwave-netbeans-capabilitiesprovider</artifactId> <version>1.1.26</version> </dependency> <dependency> <groupId>it.tidalwave.netbeans</groupId> <artifactId>it-tidalwave-netbeans-docking</artifactId> <version>1.1.14</version> • The <dependencyManagement> section </dependency> ... </dependencies> • </dependencyManagement> Declare all the versions of the dependencies used in a project just once, in a parent POM (DRY) • Children POMs won’t need to declare the version again • The <dependencyManagement> section can be imported • Import a single POM specifying its single version • Maven will “unpack” from it all the declared versions at once Efficient development of large NetBeans Platform applications with Maven 24 Friday, September 24, 2010
  • 166.
    <dependencyManagement> Smart dependency convergence <dependencies> <dependency> <groupId>it.tidalwave.netbeans</groupId> <artifactId>it-tidalwave-netbeans-capabilitiesprovider</artifactId> <version>1.1.26</version> </dependency> <dependency> <groupId>it.tidalwave.netbeans</groupId> <artifactId>it-tidalwave-netbeans-docking</artifactId> <version>1.1.14</version> • The <dependencyManagement> section </dependency> ... </dependencies> • </dependencyManagement> Declare all the versions of the dependencies used in a project just once, in a parent POM (DRY) <dependencyManagement> <dependencies> <dependency> • Children POMs won’t need to declare the version again <groupId>it.tidalwave.semantic</groupId> <artifactId>semantic</artifactId> <version>0.10.19</version> • The <dependencyManagement> section can be imported <type>pom</type> <scope>import</scope> </dependency> • <dependency> Import a single POM specifying its single version <groupId>it.tidalwave.netbeans</groupId> <artifactId>openbluesky</artifactId> • <version>0.8.4</version> Maven will “unpack” from it all the declared versions at once <type>pom</type> <scope>import</scope> </dependency> ... </dependencies> </dependencyManagement> Efficient development of large NetBeans Platform applications with Maven 24 Friday, September 24, 2010
  • 167.
    Optimizing a MavenPlatform project Efficient development of large NetBeans Platform applications with Maven 25 Friday, September 24, 2010
  • 168.
    Optimizing a MavenPlatform project Master POM 1 Branding Module POM 1 Application Module POM * Other NBM POM Efficient development of large NetBeans Platform applications with Maven 25 Friday, September 24, 2010
  • 169.
    Optimizing a MavenPlatform project Master POM Master POM 1 Modules POM 1 Branding Module POM 1 Branding Module POM 1 Application Module POM 1 Application Module POM * Other NBM POM * Other NBM POM Efficient development of large NetBeans Platform applications with Maven 25 Friday, September 24, 2010
  • 170.
    Optimizing a MavenPlatform project Master POM Master POM 1 Modules POM Contains 1 Branding dependencyManagement of modules imported by this Module POM project 1 Branding Module POM 1 Application Module POM 1 Application Module POM * Other NBM POM * Other NBM POM Efficient development of large NetBeans Platform applications with Maven 25 Friday, September 24, 2010
  • 171.
    Optimizing a MavenPlatform project Contains dependencyManagement of Master POM modules exported by this project Master POM 1 Modules POM Contains 1 Branding dependencyManagement of modules imported by this Module POM project 1 Branding Module POM 1 Application Module POM 1 Application Module POM * Other NBM POM * Other NBM POM Efficient development of large NetBeans Platform applications with Maven 25 Friday, September 24, 2010
  • 172.
    Optimizing a MavenPlatform project A single POM import retrieves all the correct modules versions in a consistent way Other project Contains POM dependencyManagement of Master POM <<imports>> modules exported by this project Master POM 1 Modules POM Contains 1 Branding dependencyManagement of modules imported by this Module POM project 1 Branding Module POM 1 Application Module POM 1 Application Module POM * Other NBM POM * Other NBM POM Efficient development of large NetBeans Platform applications with Maven 25 Friday, September 24, 2010
  • 173.
    The NBPWR project From there, it’s optional. If you ran out of time, just mention the project Efficient development of large NetBeans Platform applications with Maven 26 Friday, September 24, 2010
  • 174.
    The NBPWR project From there, it’s optional. If you ran out of time, just mention the project • The NetBeans Platform needs to “wrap” non-platform jar libraries Efficient development of large NetBeans Platform applications with Maven 26 Friday, September 24, 2010
  • 175.
    The NBPWR project From there, it’s optional. If you ran out of time, just mention the project • The NetBeans Platform needs to “wrap” non-platform jar libraries • Declare public API, dependencies, other platform properties, ... Efficient development of large NetBeans Platform applications with Maven 26 Friday, September 24, 2010
  • 176.
    The NBPWR project From there, it’s optional. If you ran out of time, just mention the project • The NetBeans Platform needs to “wrap” non-platform jar libraries • Declare public API, dependencies, other platform properties, ... • Not hard, but it’s a waste to redo the same thing over and over for multiple projects Efficient development of large NetBeans Platform applications with Maven 26 Friday, September 24, 2010
  • 177.
    The NBPWR project From there, it’s optional. If you ran out of time, just mention the project • The NetBeans Platform needs to “wrap” non-platform jar libraries • Declare public API, dependencies, other platform properties, ... • Not hard, but it’s a waste to redo the same thing over and over for multiple projects • The “NetBeans Platform Wrapper Repository” project provides reusable wrappers for some common FLOSS libraries Efficient development of large NetBeans Platform applications with Maven 26 Friday, September 24, 2010
  • 178.
    NBPWR issues Efficient development of large NetBeans Platform applications with Maven 27 Friday, September 24, 2010
  • 179.
    NBPWR issues • Needs an alternate coordinate schema Efficient development of large NetBeans Platform applications with Maven 27 Friday, September 24, 2010
  • 180.
    NBPWR issues • Needs an alternate coordinate schema • Can’t use the original artifact coordinates + changing the packaging Efficient development of large NetBeans Platform applications with Maven 27 Friday, September 24, 2010
  • 181.
    NBPWR issues • Needs an alternate coordinate schema • Can’t use the original artifact coordinates + changing the packaging • Also for having dependencies on a wrapped NBM, not the original JAR Efficient development of large NetBeans Platform applications with Maven 27 Friday, September 24, 2010
  • 182.
    NBPWR issues org.swinglabs:swingx:1.6 becomes com.kenai.nbpwr:org-jdesktop-swingx:1.6-201002261215 • Needs an alternate coordinate schema • Can’t use the original artifact coordinates + changing the packaging • Also for having dependencies on a wrapped NBM, not the original JAR Efficient development of large NetBeans Platform applications with Maven 27 Friday, September 24, 2010
  • 183.
    NBPWR issues org.swinglabs:swingx:1.6 becomes com.kenai.nbpwr:org-jdesktop-swingx:1.6-201002261215 • Needs an alternate coordinate schema • Can’t use the original artifact coordinates + changing the packaging • Also for having dependencies on a wrapped NBM, not the original JAR • Needs a further versioning qualifier Efficient development of large NetBeans Platform applications with Maven 27 Friday, September 24, 2010
  • 184.
    NBPWR issues org.swinglabs:swingx:1.6 becomes com.kenai.nbpwr:org-jdesktop-swingx:1.6-201002261215 • Needs an alternate coordinate schema • Can’t use the original artifact coordinates + changing the packaging • Also for having dependencies on a wrapped NBM, not the original JAR • Needs a further versioning qualifier • Errors might be done e.g. in declaring the public API, thus needing a fix release targeting the same original library version Efficient development of large NetBeans Platform applications with Maven 27 Friday, September 24, 2010
  • 185.
    NBPWR issues org.swinglabs:swingx:1.6 becomes com.kenai.nbpwr:org-jdesktop-swingx:1.6-201002261215 • Needs an alternate coordinate schema • Can’t use the original artifact coordinates + changing the packaging • Also for having dependencies on a wrapped NBM, not the original JAR • Needs a further versioning qualifier • Errors might be done e.g. in declaring the public API, thus needing a fix release targeting the same original library version • It’s possible to attach original sources and javadocs Efficient development of large NetBeans Platform applications with Maven 27 Friday, September 24, 2010
  • 186.
    NBPWR issues org.swinglabs:swingx:1.6 becomes com.kenai.nbpwr:org-jdesktop-swingx:1.6-201002261215 • Needs an alternate coordinate schema • Can’t use the original artifact coordinates + changing the packaging • Also for having dependencies on a wrapped NBM, not the original JAR • Needs a further versioning qualifier • Errors might be done e.g. in declaring the public API, thus needing a fix release targeting the same original library version • It’s possible to attach original sources and javadocs • Granularity: one .nbm per .jar or aggregates? Efficient development of large NetBeans Platform applications with Maven 27 Friday, September 24, 2010
  • 187.
    NBPWR usage Efficient development of large NetBeans Platform applications with Maven 28 Friday, September 24, 2010
  • 188.
    NBPWR usage • You might not like some NBPWR decisions Efficient development of large NetBeans Platform applications with Maven 28 Friday, September 24, 2010
  • 189.
    NBPWR usage • You might not like some NBPWR decisions • Interested in feedback about this! Efficient development of large NetBeans Platform applications with Maven 28 Friday, September 24, 2010
  • 190.
    NBPWR usage • You might not like some NBPWR decisions • Interested in feedback about this! • Still, a NBPWR-like approach is time-saving inside a given corporate / workgroup Efficient development of large NetBeans Platform applications with Maven 28 Friday, September 24, 2010
  • 191.
    NBPWR usage • You might not like some NBPWR decisions • Interested in feedback about this! • Still, a NBPWR-like approach is time-saving inside a given corporate / workgroup • Cooperating, it could become a standard way of doing things Efficient development of large NetBeans Platform applications with Maven 28 Friday, September 24, 2010
  • 192.
    Conclusion Efficientdevelopment of large NetBeans Platform applications with Maven 29 Friday, September 24, 2010
  • 193.
    Conclusion • The NB Platform is a highly modular and scalable framework Efficient development of large NetBeans Platform applications with Maven 29 Friday, September 24, 2010
  • 194.
    Conclusion • The NB Platform is a highly modular and scalable framework • The And Build Harness might not scale with your needs Efficient development of large NetBeans Platform applications with Maven 29 Friday, September 24, 2010
  • 195.
    Conclusion • The NB Platform is a highly modular and scalable framework • The And Build Harness might not scale with your needs • Cross-dependencies in large projects might be a problem Efficient development of large NetBeans Platform applications with Maven 29 Friday, September 24, 2010
  • 196.
    Conclusion • The NB Platform is a highly modular and scalable framework • The And Build Harness might not scale with your needs • Cross-dependencies in large projects might be a problem • Maven is a valuable and effective alternative Efficient development of large NetBeans Platform applications with Maven 29 Friday, September 24, 2010
  • 197.
    Conclusion • The NB Platform is a highly modular and scalable framework • The And Build Harness might not scale with your needs • Cross-dependencies in large projects might be a problem • Maven is a valuable and effective alternative • Intuitive artifact management and cross-dependency management Efficient development of large NetBeans Platform applications with Maven 29 Friday, September 24, 2010
  • 198.
    Conclusion • The NB Platform is a highly modular and scalable framework • The And Build Harness might not scale with your needs • Cross-dependencies in large projects might be a problem • Maven is a valuable and effective alternative • Intuitive artifact management and cross-dependency management • Your Platform project just becomes a standard Maven project Efficient development of large NetBeans Platform applications with Maven 29 Friday, September 24, 2010
  • 199.
    Conclusion • The NB Platform is a highly modular and scalable framework • The And Build Harness might not scale with your needs • Cross-dependencies in large projects might be a problem • Maven is a valuable and effective alternative • Intuitive artifact management and cross-dependency management • Your Platform project just becomes a standard Maven project • Can be used with other IDEs - easy QA & Continuous Integration Efficient development of large NetBeans Platform applications with Maven 29 Friday, September 24, 2010
  • 200.
    Conclusion • The NB Platform is a highly modular and scalable framework • The And Build Harness might not scale with your needs • Cross-dependencies in large projects might be a problem • Maven is a valuable and effective alternative • Intuitive artifact management and cross-dependency management • Your Platform project just becomes a standard Maven project • Can be used with other IDEs - easy QA & Continuous Integration • Beware: to be effective, Maven needs some pieces of infrastructure! Efficient development of large NetBeans Platform applications with Maven 29 Friday, September 24, 2010
  • 201.
    Conclusion • The NB Platform is a highly modular and scalable framework • The And Build Harness might not scale with your needs • Cross-dependencies in large projects might be a problem • Maven is a valuable and effective alternative • Intuitive artifact management and cross-dependency management • Your Platform project just becomes a standard Maven project • Can be used with other IDEs - easy QA & Continuous Integration • Beware: to be effective, Maven needs some pieces of infrastructure! • Ant vs Maven is partly subjective Efficient development of large NetBeans Platform applications with Maven 29 Friday, September 24, 2010
  • 202.
    Question time Efficient development of large NetBeans Platform applications with Maven 30 Friday, September 24, 2010
  • 203.
    Question time • Follow me • at my Java.Net blog • at DZone • Useful links • http://platform.netbeans.org • http://wiki.netbeans.org/MavenBestPractices • http://forceten.tidalwave.it/development/tutorials/using-the-geoexplorer- and-the-geoviewer/ • http://bluemarine.tidalwave.it Efficient development of large NetBeans Platform applications with Maven 30 Friday, September 24, 2010