• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Netbeans+platform+maven
 

Netbeans+platform+maven

on

  • 2,792 views

 

Statistics

Views

Total Views
2,792
Views on SlideShare
2,605
Embed Views
187

Actions

Likes
0
Downloads
62
Comments
0

7 Embeds 187

http://weblogs.java.net 172
http://www.java.net 5
http://static.slidesharecdn.com 4
http://www.gayanb.com 2
https://weblogs.java.net 2
http://java.hoofoo.net 1
http://www.rss4java.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Netbeans+platform+maven Netbeans+platform+maven Presentation Transcript

    • 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