| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head> |
| <title>Quick Start for NetBeans Platform 6.8 Using Maven</title> |
| <link rel="stylesheet" type="text/css" href="https://netbeans.org/netbeans.css"/> |
| <meta name="AUDIENCE" content="NBUSER"/> |
| <meta name="TYPE" content="ARTICLE"/> |
| <meta name="EXPIRES" content="N"/> |
| <meta name="indexed" content="y"/> |
| <meta name="description" |
| content="A short guide to getting started with the NetBeans Platform."/> |
| </head> |
| <body> |
| |
| <h1>Quick Start for NetBeans Platform 6.8 Using Maven</h1> |
| |
| <p>Welcome to the <a href="https://platform.netbeans.org/"><b>NetBeans Platform</b></a>!</p> |
| |
| <p>This document is a quick demonstration of how to create a simple |
| NetBeans Platform application and module and use Maven for the build framework. |
| In this document you will use Maven archetypes to create the NetBeans Platform application and module. |
| You will use the Swing UI toolkit and "Matisse" GUI Builder to create a window component in the module. |
| The modular aspect of the NetBeans Platform enables you to develop and expand the functionality |
| of your application simply by adding new modules. |
| </p> |
| |
| <p>This document is based on the Ant-based <a href="../nbm-quick-start.html">NetBeans Platform Quick Start for NetBeans Platform 6.8</a>. |
| and illustrates some of the differences between using Ant and Maven to develop NetBeans Platform applications. |
| After you understand how Maven is different from Ant, you can easily proceed through other |
| tutorials on the the <a href="https://netbeans.org/kb/trails/platform.html">NetBeans Platform Learning Trail</a>. |
| </p> |
| <!--<p class="tips">If you are new to using Maven in the IDE, you might want to |
| read the <a href="https://netbeans.org/kb/docs/java/gui-functionality.html">Introduction to GUI Building</a></li>--> |
| |
| <p class="tips">If you are new to the NetBeans Platform, you might want to watch the |
| the screencast series <a href="https://platform.netbeans.org/tutorials/nbm-10-top-apis.html">Top 10 NetBeans APIs</a>.</p> |
| |
| <p><b>Contents</b></p> |
| <p><img src="../../images/articles/68/netbeans-stamp.gif" class="stamp" width="114" height="114" alt="Content on this page applies to NetBeans IDE 6.5, 6.7, 6.8" title="Content on this page applies to NetBeans IDE 6.5, 6.7, 6.8"/></p> |
| <ul class="toc"> |
| <li><a href="#config">Configuring Maven</a> |
| <ul> |
| <li><a href="#config1">Viewing the Maven Repositories</a></li> |
| </ul> |
| </li> |
| <li><a href="#01">Creating the NetBeans Platform Application Project</a></li> |
| <li><a href="#02">Modifying the Sample Module</a> |
| <ul> |
| <li><a href="#02a">Adding a Window Component to the Sample Module</a></li> |
| <li><a href="#02b">Modifying the Window Component</a></li> |
| <li><a href="#02c">Building and Running the Application</a></li> |
| </ul> |
| </li> |
| <li><a href="#03">Updating the Platform Version and Splash Image</a> |
| <ul> |
| <li><a href="#03a">Updating the Platform Version in the NetBeans Platform Application</a></li> |
| <li><a href="#03b">Updating the Dependencies in NetBeans Platform Based Application</a></li> |
| <li><a href="#03c">Replacing the Splash Screen</a></li> |
| <li><a href="#03d">Testing the Application</a></li> |
| </ul> |
| </li> |
| </ul> |
| |
| <p><b>To follow this tutorial, you need the software and resources listed in the following table.</b></p> |
| |
| <table> |
| <tbody> |
| <tr> |
| <th class="tblheader" scope="col">Software or Resource</th> |
| <th class="tblheader" scope="col">Version Required</th> |
| </tr> |
| <tr> |
| <td class="tbltd1"><a href="https://netbeans.org/downloads/index.html">NetBeans IDE</a></td> |
| <td class="tbltd1">version 6.8</td> |
| </tr> |
| <tr> |
| <td class="tbltd1"><a href="http://java.sun.com/javase/downloads/index.jsp">Java Developer Kit (JDK)</a></td> |
| <td class="tbltd1">Version 6 or<br/>version 5</td> |
| </tr> |
| <tr> |
| <td class="tbltd1"><a href="http://maven.apache.org/">Maven</a></td> |
| <td class="tbltd1">Version 2.0.9 or higher</td> |
| </tr> |
| <tr> |
| <td class="tbltd1"><a href="http://subversion.tigris.org/">Subversion</a></td> |
| <td class="tbltd1">Version 1.6.x</td> |
| </tr> |
| </tbody> |
| </table> |
| |
| <p><strong class="notes">Note:</strong> You do not need to download a separate version |
| of the NetBeans Platform to develop applications for the NetBeans Platform. |
| Typically, you develop the applications and modules in the NetBeans IDE and |
| then only include the modules that are necessary to run the NetBeans Platform and your application. |
| </p> |
| |
| <p>Before starting this tutorial you may want to familiarize yourself with |
| the following documentation.</p> |
| <ul> |
| <li><a href="http://wiki.netbeans.org/MavenBestPractices">Best Practices for Apache Maven in NetBeans 6.x</a></li> |
| <li><a href="http://www.sonatype.com/books/maven-book/reference/introduction.html">Chapter 1. Introducing Apache Maven</a> |
| (from <a href="http://www.sonatype.com/books/maven-book/reference/public-book.html">Maven: The Definitive Guide</a>)</li> |
| <li><a href="https://netbeans.org/kb/docs/java/gui-functionality.html">Introduction to GUI Building</a></li> |
| </ul> |
| |
| <!-- ===================================================================================== --> |
| |
| |
| |
| <h2><a name="config"></a>Configuring Maven</h2> |
| <p>If this is your first Maven project you will want to check the Maven configuration settings in the Options window. |
| To complete this tutorial you must have Maven installed on your local system. |
| You can download the installer from the <a href="http://maven.apache.org/">Maven site</a>.</p> |
| |
| <ol> |
| <li>Select the Miscellaneous category in the Options window and click the Maven tab.</li> |
| <li>Specify the location of your local Maven installation (requires 2.0.9 or newer).</li> |
| <li>Check that the location of the local Maven repository is correct.</li> |
| <li>Click OK.</li> |
| </ol> |
| <p>The IDE uses your local Subversion client to retrieve Maven artifacts from remote repositories. |
| You might want to check that a Subversion client is installed and configured correctly by typing <tt>svn --version</tt> on |
| the command line.</p> |
| <p class="tips">For details on setting up Subversion, see the |
| <a href="https://netbeans.org/kb/docs/ide/subversion.html">Guided Tour of Subversion</a>.</p> |
| |
| <div class="indent"> |
| <h3><a name="config1"></a>Viewing the Maven Repositories</h3> |
| <p>The artifacts that are used by Maven to build all your projects are stored in your local Maven repository. |
| When an artifact is declared as a project dependency, the artifact is downloaded to your local repository |
| from one of the registered remote repositories.</p> |
| |
| <p>The NetBeans repository and several well-known indexed Maven repositories are registered and listed in the Repository Browser window by default. |
| The NetBeans repository contains most of the public artifacts necessary for you to build your project. |
| You can use the Maven Repository Browser to view the contents of your local and remote repositories. |
| You can expand the Local Repository node to see the artifacts that are present locally. |
| The artifacts listed under the NetBeans repository nodes can be added as project dependencies, but not all of |
| them are present locally. They are only added to the Local Repository when they are declared as project |
| dependencies.</p> |
| |
| <p>To open the Maven Repository Browser:</p> |
| <ul> |
| <li>Choose Window > Other > Maven Repository Browser from the main menu.<br/> |
| <img src="../../images/tutorials/maven-quickstart68/maven-nbm-netbeans-repo.png" alt="Screenshot of Maven Repository Browser" title="Screenshot of Maven Repository Browser" class="margin-around b-all" /> |
| </li> |
| </ul> |
| |
| |
| <p>When your cursor is over an artifact, the IDE displays a tooltip with the artifact's coordinates. |
| You can view additional details about an artifact by double-clicking the artifact's JAR file in the browser.</p> |
| |
| <p class="tips">You can search for an artifact by clicking the Find button in the toolbar of the Maven Repository Browser |
| or by using the Quicksearch textfield in the main toolbar.</p> |
| <p class="tips">For more about managing Maven classpath dependencies and working with Maven repositories in the IDE, |
| see the <a href="http://wiki.netbeans.org/MavenBestPractices#Dependency_management">Dependency Management</a> |
| section of <a href="http://wiki.netbeans.org/MavenBestPractices">Best Practices for Apache Maven in NetBeans 6.x</a>. |
| </p> |
| <p class="tips">To see a demonstration of using the Artifact Viewer, see the <a href="https://netbeans.org/kb/docs/java/maven-dependencies-screencast.html"> Working with Maven Dependencies</a> screencast.</p> |
| |
| </div> |
| |
| <h2><a name="01"></a>Creating the NetBeans Platform Application Project</h2> |
| |
| <p>In this section you use the New Project wizard to create a |
| NetBeans Platform Application from a Maven archetype. |
| The wizard will create the Maven module projects that you need to develop a NetBeans Platform application. |
| The wizard also creates a sample module that provides an example of how the Maven projects are configured. |
| In this quickstart you will modify the default sample module, |
| but you can delete the sample module when you develop your own applications.</p> |
| |
| |
| <p>Perform the following steps to create the NetBeans Platform application using the New Project wizard.</p> |
| <ol> |
| <li>Choose File > New Project (Ctrl-Shift-N) to open the New Project wizard.</li> |
| <li>Select Maven Project from the Maven category. Click Next.</li> |
| <li>Select Maven NetBeans Platform Application Archetype. Click Next.</li> |
| <li>Type <strong>MavenPlatformWordApp</strong> for the Project Name and set the Project Location. Click Finish. <br/> |
| <img src="../../images/tutorials/maven-quickstart68/maven-nbm-newprojectwizard1.png" alt="Screenshot of New Project wizard" title="Screenshot of New Project wizard" class="margin-around b-all" /> |
| </li> |
| </ol> |
| |
| <p class="notes"><strong>Note.</strong> If this is your first NetBeans Platform application using Maven, |
| it can take some time to create the projects because the IDE needs to download any necessary artifacts |
| from the NetBeans repository.</p> |
| |
| <p>When you click Finish, by default the IDE creates the following Maven project types.</p> |
| <ul> |
| <li><strong>NetBeans Platform Application.</strong> |
| This project is a container project for the Platform application and lists the modules to include and the location of the project's repositories. This project does not contain any sources. |
| The IDE generates the modules containing the sources and resources in sub-directories of this project.</li> |
| <li><strong>NetBeans Platform based application.</strong> |
| This project specifies the artifacts (sources) needed for compiling the application. |
| The required dependencies (IDE artifacts, module artifacts) are specified in the <tt>pom.xml</tt> file |
| of the project.</li> |
| <li><strong>Platform application branding resources.</strong> |
| This project contains the resources used for branding the application. </li> |
| <li><strong>sample NetBeans Module.</strong> |
| This project is created by default as an example of a module of a platform application. |
| This project is not required to compile the application. |
| When you develop your application you can delete this module and remove the module as a dependency.<br/> |
| <img src="../../images/tutorials/maven-quickstart68/maven-nbm-projectswindow1.png" alt="Screenshot of Projects window showing project structure" title="Screenshot of project structure in Projects window" class="margin-around b-all" /> |
| |
| </li> |
| </ul> |
| |
| <p>When you create the project, you will see that some of the projects |
| (for example, the NetBeans Platform based application project) are badged |
| because some dependencies declared in the <tt>pom.xml</tt> file (POM) are unavailable. |
| For all Maven projects, the POM is located under the Project Files node in the Projects window.</p> |
| |
| |
| |
| <p class="notes"><strong>Note.</strong> If the branding module appears as <tt><Badly formed Maven project></tt> |
| in the Projects window, right-click the project in the Projects window and choose Reload Project. |
| See <a href="http://wiki.netbeans.org/MavenMissingExtensionPluginError">MavenMissingExtensionPluginError</a>.</p> |
| |
| <p>If you look at the POM of the NetBeans Platform based application generated by the wizard, |
| you can see that by default the sample module artifact (<tt>module1</tt>) is listed as a required dependency for compiling the application. |
| The artifact will be available after you build the sample module project and install the artifact |
| in your local repository. |
| </p> |
| |
| <pre class="examplecode"><dependency> |
| <groupId>com.mycompany</groupId> |
| <artifactId><strong>module1</strong></artifactId> |
| <version>1.0-SNAPSHOT</version> |
| <type>nbm</type> |
| </dependency></pre> |
| |
| |
| <p>If you look at the POM for the sample module you see that the project has the <tt>artifactId</tt> <strong>module1</strong>.</p> |
| <pre class="examplecode"> |
| <parent> |
| <groupId>com.mycompany</groupId> |
| <artifactId>MavenPlatformWordApp</artifactId> |
| <version>1.0-SNAPSHOT</version> |
| </parent> |
| <modelVersion>4.0.0</modelVersion> |
| <artifactId><strong>module1</strong></artifactId> |
| <packaging>nbm</packaging> |
| <version>1.0-SNAPSHOT</version> |
| <name>MavenPlatformWordApp - sample NetBeans Module</name> |
| </pre> |
| |
| <p>The sample module is a NetBeans module. |
| To build a NetBeans module you need to use the <tt>nbm-maven-plugin</tt>. |
| If you look at the POM for the sample module, you can see that the IDE automatically |
| specified the plugin to use to build the project as a NetBeans module.</p> |
| <pre class="examplecode"> |
| <plugin> |
| <groupId>org.codehaus.mojo</groupId> |
| <artifactId><strong>nbm-maven-plugin</strong></artifactId> |
| </plugin> |
| </pre> |
| |
| <p>If you look at the POM for the NetBeans Platform Application, |
| you can see that <strong>module1</strong> is listed as one of the modules in the application.</p> |
| <pre class="examplecode"> |
| <modules> |
| <module><strong>module1</strong></module> |
| <module>branding</module> |
| <module>application</module> |
| </modules> |
| </pre> |
| |
| |
| |
| <!-- +++++++++++++++ Modifying the sample +++++++++++++++ --> |
| <h2><a name="02"></a>Modifying the Sample Module</h2> |
| |
| <p>In this section you will modify the sample module to add a window component and a button and text area.</p> |
| |
| <div class="indent"> |
| <h3><a name="02a"></a>Adding a Window Component to the Sample Module</h3> |
| |
| <p>In this exercise you will use a wizard to add a Window Component to the sample module.</p> |
| <ol> |
| <li>Right-click <strong>MavenPlatformWordApp - sample NetBeans Module</strong> in the Projects window and choose New > Other to open the New File wizard.</li> |
| <li>Select Window Component in the Module Development category. Click Next.</li> |
| <li>Select <strong>output</strong> in the Window Position dropdown list. Click Next.</li> |
| <li>Type <strong>Text</strong> in the Class Name Prefix field. Click Finish. |
| <p>The wizard displays a list of the files that will be created and the files that will be modified. </p></li> |
| </ol> |
| |
| <img src="../../images/tutorials/maven-quickstart68/maven-nbm-newwindowcomponent-sample.png" alt="Screenshot of window component page in New File wizard" title="Screenshot of window component page in New File wizard" class="margin-around b-all" /> |
| |
| |
| <p>When you click Finish, in the Projects window you can see that the IDE generated the classes <tt>TextAction.java</tt> and <tt>TextTopComponent.java</tt> in <tt>com.mycompany.mavenplatformwordapp</tt> under Source Packages. |
| The IDE also generated additional resource files in <tt>com.mycompany.mavenplatformwordapp</tt> under Other Sources. |
| In this exercise you will only edit <tt>TextTopComponent.java</tt> so you can close the other files.</p> |
| |
| <p>You can view the structure of the project in the Files window. |
| To compile a Maven project, only Java files can be located under |
| Source Packages (<tt>src/main/java</tt> directory in the Files window). |
| Non-Java files (e.g., XML files) need to be located under Other Sources |
| (<tt>src/main/resources</tt> directory in the Files window). </p> |
| |
| <h3><a name="02b"></a>Modifying the Window Component</h3> |
| |
| <p>You will now add the text area and button elements to the window component by performing the following steps.</p> |
| <ol> |
| <li>Click the Design tab of <tt>TextTopComponent.java</tt> in the editor.</li> |
| <li>Drag and drop a button and a text area from the Palette onto the window.</li> |
| <li>Right-click the text area and choose Change Variable Name, and then type <strong>text</strong> as the name. |
| You will use the name when accessing the component from your code.</li> |
| <li>Set the text of the button to "<strong>Filter!</strong>".<br/> |
| <img src="../../images/tutorials/maven-quickstart68/maven-nbm-textopcomponent.png" alt="Screenshot of window component page in New File wizard" title="Screenshot of window component page in New File wizard" class="margin-around b-all" /> |
| </li> |
| <li>Double-click the Filter! button element in the Design view to open the event handler method for the button in the source code editor. |
| The method is created automatically when you double-click the button element.</li> |
| <li>Modify the body of the method to add the following code and save your changes. |
| <pre class="examplecode"> |
| private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { |
| <strong>String s = text.getText(); |
| s = s.toUpperCase(); |
| text.setText(s);</strong> |
| }</pre> |
| <p class="tips">You can use the code completion in the editor to help you type the code. </p> |
| </li> |
| </ol> |
| |
| <h3><a name="02c"></a>Building and Running the Application</h3> |
| <ol> |
| <li>Right-click the project node of the <strong>MavenPlatformWordApp NetBeans Platform based application</strong> and choose Build with Dependencies. |
| <p>The default action mapped to Build with Dependencies is to build the project using the Reactor plugin. |
| When you build a project using the Reactor plugin, the dependencies of the sub-projects are built before the containing project is built. |
| The Output window displays the build order.</p> |
| <img src="../../images/tutorials/maven-quickstart68/maven-nbm-buildoutput1.png" alt="Screenshot of Reactor build order in Output window" title="Screenshot of Reactor build order in Output window" class="margin-around b-all" /> |
| <p>The results of the build are also displayed in the Output window.</p> |
| <img src="../../images/tutorials/maven-quickstart68/maven-nbm-buildoutput2.png" alt="Screenshot of successful Reactor build in Output window" title="Screenshot of successful Reactor build in Output window" class="margin-around b-all" /> |
| <p>If you look at the Projects window, you will see that the projects no longer have badges because |
| the artifacts of the required dependencies are now in the Local repository under the <tt>com.mycompany</tt> node.</p> |
| <img src="../../images/tutorials/maven-quickstart68/maven-nbm-localrepo.png" alt="Screenshot of Local repository" title="Screenshot of Local repository" class="margin-around b-all" /> |
| </li> |
| <li>Right-click the project node of the <strong>MavenPlatformWordApp NetBeans Platform based application</strong> and choose Run.</li> |
| </ol> |
| |
| <p>When you Run the application, the IDE launches the NetBeans Platform 6.7 application. To test the application, perform the following steps:</p> |
| <ol> |
| <li>Choose Window > Text from the main menu of the platform application.<br/> |
| <img src="../../images/tutorials/maven-quickstart68/maven-nbm-wordapp.png" alt="Screenshot of Text window in application" title="Screenshot of Text window in application" class="margin-around b-all" /> |
| </li> |
| <li>Type some characters in the text area and click Filter! </li> |
| </ol> |
| <p>When you click Filter!, the characters that you typed are changed to upper case and displayed in the text area. </p> |
| |
| </div> |
| |
| <h2><a name="03"></a>Updating the Platform Version and Splash Image</h2> |
| |
| <p>The archetype that you used to create the application specifies 6.7 as version of the platform. |
| In this section you will update the version of the NetBeans Platform to 6.8 and change the splash screen |
| that appears when you launch the application. |
| </p> |
| |
| <div class="indent"> |
| <h3><a name="03a"></a>Updating the Platform Version in NetBeans Platform Application</h3> |
| |
| <p>In this exercise you will update the POM file to specify the NetBeans 6.8 version of the artifacts.</p> |
| <ol> |
| <li>Expand the <strong>MavenPlatformWordApp NetBeans Platform Application</strong> project node in the Projects window.</li> |
| <li>Expand the Project Files node and double-click <tt>pom.xml</tt> to open the POM in the editor.</li> |
| <li>Modify the <tt><netbeans.version></tt> element to change the version to <tt>RELEASE68</tt> and save your changes. |
| <pre class="examplecode"><properties> |
| <netbeans.version><strong>RELEASE68</strong></netbeans.version> |
| <brandingToken>foo</brandingToken> |
| </properties> |
| </project> |
| </pre> |
| </li> |
| </ol> |
| |
| <h3><a name="03b"></a>Updating the Dependencies in NetBeans Platform based application</h3> |
| |
| <p>In this exercise you will update the POM file to change the artifact for the IDE cluster to platform11.</p> |
| <ol> |
| <li>Expand the <strong>MavenPlatformWordApp NetBeans Platform based application</strong> project node in the Projects window.</li> |
| <li>Expand the Project Files node and double-click <tt>pom.xml</tt> to open the POM in the editor.</li> |
| <li>Modify the <tt><artifactId></tt> element to change the version to <tt>platform11</tt> and save your changes. |
| <pre class="examplecode"> |
| <dependency> |
| <groupId>org.netbeans.cluster</groupId> |
| <artifactId><strong>platform11</strong></artifactId> |
| <version>${netbeans.version}</version> |
| <type>pom</type> |
| </dependency> |
| </pre> |
| </li> |
| </ol> |
| |
| |
| |
| <h3><a name="03c"></a>Replacing the Splash Screen</h3> |
| |
| <p>In this exercise you will replace the default splash image that is displayed when you launch the application. |
| By default the branding module generated by the IDE contains an image that is used as the splash image. |
| You can replace this with a different image by performing the following steps.</p> |
| <ol> |
| <li>Locate the default splash image (<tt>splash.gif</tt>) in the following directory of the <strong>MavenPlatformWordApp Platform application branding resources</strong> module project. |
| <ul> |
| <li>In the Projects window: <tt>Other Sources > nbm-branding > core > core.jar > org > netbeans > core > startup</tt></li> |
| <li>In the Files window: <tt>src > main > nbm-branding > core > core.jar > org > netbeans > core > startup</tt></li> |
| </ul> |
| </li> |
| <li>Replace the default image with an image named <tt>splash.gif</tt>. |
| <p>The default size of the splash image is 473 x 300. |
| For example, you can copy the image below to the <tt>startup</tt> directory.</p> |
| <img src="../../images/tutorials/maven-quickstart68/splash.gif" alt="Example of default splash image" title="Example of default splash image" class="margin-around b-all" /> |
| </li> |
| </ol> |
| |
| <h3>Building and Running the Application</h3> |
| <p>You can now build and run the NetBeans Platform application again by performing the same steps as before.</p> |
| <ol> |
| <li>Right-click the project node of the <strong>MavenPlatformWordApp NetBeans Platform based application</strong> and choose Clean.</li> |
| <li>Right-click the project node of the <strong>MavenPlatformWordApp NetBeans Platform based application</strong> and choose Build with Dependencies.</li> |
| <li>Right-click the project node of the <strong>MavenPlatformWordApp NetBeans Platform based application</strong> and choose Run. |
| <p>When you click Run, you can see in the Output window the the IDE now builds the standalone NetBeans Platform |
| application using the NetBeans Platform 6.8 cluster <tt>Platform11</tt>.</p> |
| <img src="../../images/tutorials/maven-quickstart68/maven-nbm-runupdated.png" alt="Screenshot of Local repository" title="Screenshot of Local repository" class="margin-around b-all" /> |
| <p>The application also displays the new splash image when the application starts.</p> |
| |
| </li> |
| </ol> |
| |
| </div> |
| |
| <p>This quickstart demonstrated how creating a NetBeans Platform application using Maven |
| is not very different from creating an application using Ant. |
| The major difference is understanding how the Maven POM controls how the application is assembled. |
| For more examples on how to build NetBeans Platform applications and modules, |
| see the tutorials listed in the <a href="https://netbeans.org/kb/trails/platform.html">NetBeans Platform Learning Trail</a>.</p> |
| |
| <p>There will soon be more examples that demonstrate how to use Maven to build NetBeans Platform applications.</p> |
| |
| <p>If you have any questions about the NetBeans Platform, feel free |
| to write to the mailing list, dev@platform.netbeans.org, or view the |
| <a href="https://netbeans.org/projects/platform/lists/dev/archive">NetBeans Platform mailing list archive</a>.</p> |
| <!-- |
| <p>The application consists of 4 modules. Code from one module can only |
| be used by another module if (1) the first module explicitly exposes |
| packages and (2) the second module sets a dependency on the first module. |
| In this way, the NetBeans Platform helps to organize your code in a |
| strict modular architecture, ensuring that code isn't reused randomly |
| but only when there are contracts set between the modules that provide |
| the code.</p> |
| |
| <p>Secondly, the <tt>Lookup</tt> class has been introduced as |
| a mechanism for communicating between modules, as an extension of the |
| JDK 6 ServiceLoader approach. Implementations are loaded via their |
| interfaces. Without using any code from an implementation, the "WordEngine" |
| module is able to display the service provided by the implementor. Loose |
| coupling is provided to NetBeans Platform applications in this way.</p> |
| |
| <p class="tips"> To continue learning about modularity |
| and the NetBeans Platform, head on to |
| the 4-part "NetBeans Platform Selection |
| Management" series, <a href="https://platform.netbeans.org/tutorials/nbm-selection-1.html">which starts here</a>. |
| After that, get started with the <a href="https://netbeans.org/kb/trails/platform.html">NetBeans Platform Learning Trail</a>, choosing |
| the tutorials that are most relevant to your particular business scenario. |
| --> |
| |
| |
| |
| |
| </body> |
| |
| </html> |