From Event to Action: Accelerate Your Decision Making with Real-Time Automation
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
Efficient development 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 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
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 Ant Build Harness
Efficient development of large NetBeans Platform applications with Maven 7
Friday, September 24, 2010
30. 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
31. 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
32. 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
33. 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
34. 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
35. 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
36. 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
37. 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
38. 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
39. Using the Ant Build Harness
Efficient development of large NetBeans Platform applications with Maven 8
Friday, September 24, 2010
40. 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
41. 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
42. 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
43. 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
44. 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
45. 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
46. 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
47. When Ant might not scale
Efficient development of large NetBeans Platform applications with Maven 9
Friday, September 24, 2010
48. 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
49. 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
50. 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
51. 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
52. 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
53. 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
54. 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
55. 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
56. 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
57. 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
58. 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
59. 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
60. 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
61. 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
62. 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
63. 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
64. 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
65. 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
66. Reusing modules with the Ant build harness
Efficient development of large NetBeans Platform applications with Maven 11
Friday, September 24, 2010
67. 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
68. 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
69. 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
70. 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
71. 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
72. 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
73. 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
74. 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
75. 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
76. Limits of Custom Platforms with Ant
Efficient development of large NetBeans Platform applications with Maven 12
Friday, September 24, 2010
77. 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
78. 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
79. 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
80. 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
81. 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
82. 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
83. 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
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
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 Maven Plugin
Efficient development of large NetBeans Platform applications with Maven 16
Friday, September 24, 2010
113. 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
114. 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
115. 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
116. 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
117. 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
118. 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
119. 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
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
Efficient development 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 NBM modules in non-platform projects
Efficient development of large NetBeans Platform applications with Maven 21
Friday, September 24, 2010
143. 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
144. 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
145. 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
146. 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
147. 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
148. 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
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 Maven Platform project
Efficient development of large NetBeans Platform applications with Maven 25
Friday, September 24, 2010
168. 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
169. 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
170. 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
171. 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
172. 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