| <!doctype html> |
| <html class="no-js" lang="en" dir="ltr"> |
| <head> |
| <meta charset="utf-8"> |
| <meta http-equiv="x-ua-compatible" content="ie=edge"> |
| <title>NetBeans Platform File Type Tutorial Using Maven</title> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <meta name="description" content="NetBeans Platform File Type Tutorial Using Maven - Apache NetBeans"> |
| <meta name="author" content="Apache NetBeans"> |
| <meta name="description" content="NetBeans Platform File Type Tutorial Using Maven - Apache NetBeans"> |
| <meta name="keywords" content="Apache NetBeans Platform, Platform Tutorials, NetBeans Platform File Type Tutorial Using Maven"> |
| <meta name="generator" content="Apache NetBeans"> |
| <link rel="stylesheet" href="../../../../_/css/font-awesome.min.css"> |
| <link rel="alternate" type="application/atom+xml" title="Apache NetBeans Blog" href="https://netbeans.apache.org/blogs/atom" /> |
| <link rel="stylesheet" href="../../../../_/css/highlightjs/default.min.css"> |
| <link rel="stylesheet" href="../../../../_/css/netbeans.css"> |
| <link rel="apple-touch-icon" sizes="180x180" href="../../../../_/images/fav/apple-touch-icon.png"> |
| <link rel="icon" type="image/png" sizes="32x32" href="../../../../_/images/fav/favicon-32x32.png"> |
| <link rel="icon" type="image/png" sizes="16x16" href="../../../../_/images/fav/favicon-16x16.png"> |
| <link rel="manifest" href="../../../../_/images/fav/site.webmanifest"> |
| <link rel="mask-icon" href="../../../../_/images/fav/safari-pinned-tab.svg" color="#5bbad5"> |
| <meta name="msapplication-TileColor" content="#ffc40d"> |
| <meta name="theme-color" content="#ffffff"> |
| <link href="../../../../_/css/font-open-sans.css" rel="stylesheet"> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| http://www.apache.org/licenses/LICENSE-2.0 |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| --> |
| </head> |
| <body> |
| <div class="title-bar" data-responsive-toggle="responsive-menu" data-hide-for="medium"> |
| <button type="button" data-toggle="responsive-menu"><i style='font-size: 32px; color: #fff; padding: 8px' class='fa fa-bars'></i></button> |
| <div class="title-bar-title">Apache NetBeans</div> |
| </div> |
| <div class="top-bar" id="responsive-menu"> |
| <div class='top-bar-left'> |
| <a class='title' href="../../../../index.html"><img src='../../../../_/images/apache-netbeans.svg' style='padding: 8px; height: 48px;'> Apache NetBeans</a> |
| </div> |
| <div class="top-bar-right"> |
| <ul class="vertical medium-horizontal menu" data-responsive-menu="drilldown medium-dropdown"> |
| <li> <input id="search-input" type="text" placeholder="Search the docs"> </li> |
| <li> <a href="../../../../front/main/community">Community</a> </li> |
| <li> <a href="../../../../front/main/participate">Participate</a> </li> |
| <li> <a href="../../../../front/main/blogs">Blog</a></li> |
| <li> <a href="../../../../front/main/help">Get Help</a> </li> |
| <li> <a href="https://plugins.netbeans.apache.org/">Plugins</a> </li> |
| <li> <a href="../../../../front/main/download">Download</a> </li> |
| </ul> |
| </div> |
| </div> |
| |
| <!-- src/templates/news --> |
| <section class="hero news alternate"> |
| <div class='grid-container'> |
| <div class='cell'> |
| <div class="annotation">Latest release</div> |
| <h1>Apache NetBeans 27</h1> |
| <p><a class="button success" href="../../../../front/main/download/nb27">Download</a></p> |
| </div> |
| </div> |
| </section> |
| <div class='grid-container main-content tutorial'> |
| <h1 class="sect0">NetBeans Platform File Type Tutorial Using Maven</h1> |
| <div class="sectionbody"> |
| <div class="admonitionblock note"> |
| <table> |
| <tbody><tr> |
| <td class="icon"><i class="fa icon-note" title="Note"></i></td> |
| <td class="content">This tutorial needs a review. |
| You can <a href="https://github.com/apache/netbeans-antora-tutorials/edit/main/modules/ROOT/pages/tutorials/nbm-maven-modulesingle.adoc" title="Edit this tutorial in github">edit it in GitHub </a> |
| following these <a href="../../../../tutorial/main/kb/docs/contributing">contribution guidelines.</a></td> |
| </tr></tbody> |
| </table> |
| </div> |
| </div> |
| <div id="toc" class="toc"> |
| <div id="toctitle"></div> |
| <ul class="sectlevel1"> |
| <li><a href="#_creating_the_module_project">Creating the Module Project</a></li> |
| <li><a href="#_recognizing_the_file_type">Recognizing the File Type</a></li> |
| <li><a href="#_building_and_running_the_project">Building and Running the Project</a></li> |
| <li><a href="#_adding_an_action_for_the_file_type">Adding an Action for the File Type</a></li> |
| <li><a href="#_see_also">See Also</a></li> |
| </ul> |
| </div> |
| <div id="preamble"> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>This document demonstrates how to create a NetBeans module from a Maven archetype and build and install the module in NetBeans IDE or any other application on the NetBeans Platform. In this tutorial, you will create a module project that when installed enables you to recognize a new type of file in your projects. The module also creates a menu action that is available when the user right-click a file conforming to the new file type.</p> |
| </div> |
| <div class="paragraph"> |
| <p>This document is based on the Ant-based <a href="../nbm-filetype/" class="xref page">NetBeans File Type Tutorial</a> and can be used to learn some of the differences between using Ant and Maven to develop NetBeans modules. After you understand the differences, you can easily proceed through other tutorials on the <a href="../../kb/docs/platform/" class="xref page">NetBeans Platform Learning Trail</a>.</p> |
| </div> |
| <div class="admonitionblock note"> |
| <table> |
| <tr> |
| <td class="icon"> |
| <i class="fa icon-note" title="Note"></i> |
| </td> |
| <td class="content"> |
| You do not need to download Maven because it is bundled with the IDE. Optionally, use your own download of Maven, in which case use the Options window to configure your Maven settings. |
| </td> |
| </tr> |
| </table> |
| </div> |
| <div class="paragraph"> |
| <p>Before starting this tutorial you may want to familiarize yourself with the following introductory Maven documentation:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p><a href="../../../../wiki/main/wiki/MavenBestPractices/" class="xref page">Best Practices for Maven in NetBeans IDE</a></p> |
| </li> |
| <li> |
| <p><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>)</p> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_creating_the_module_project"><a class="anchor" href="#_creating_the_module_project"></a>Creating the Module Project</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>In this section you create a NetBeans module project from a Maven archetype.</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="1"> |
| <li> |
| <p>Open the New Project wizard and choose NetBeans Module in the Maven category:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/maven-single_71_pic1.png" alt="maven single 71 pic1"> |
| </div> |
| <div class="title">Figure 1. Module wizard 1</div> |
| </div> |
| <div class="paragraph"> |
| <p>Click Next.</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="2"> |
| <li> |
| <p>Type <strong>AbcFileTypeSupport</strong> in Project Name and specify a location for storing the project:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/maven-single_71_pic2.png" alt="maven single 71 pic2"> |
| </div> |
| <div class="title">Figure 2. Module wizard 2</div> |
| </div> |
| <div class="paragraph"> |
| <p>Click Next. Specify the NetBeans API version you want to use. Click Finish.</p> |
| </div> |
| <div class="paragraph"> |
| <p>When you click Finish, the IDE creates the AbcFileTypeSupport project:</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/maven-single_71_pic4.png" alt="maven single 71 pic4"> |
| </div> |
| <div class="title">Figure 3. Module wizard 2</div> |
| </div> |
| <div class="paragraph"> |
| <p>If you look in the POM, shown above, you can see that Maven will use the <code> <a href="http://maven.apache.org/plugins/maven-jar-plugin/">maven-jar-plugin</a></code> to build the JAR and the <code> <a href="http://bits.netbeans.org/mavenutilities/nbm-maven-plugin/">nbm-maven-plugin</a></code> will package the JAR as a NetBeans Module ( <code>nbm</code> ).</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><modelVersion>4.0.0</modelVersion> |
| |
| <groupId>com.mycompany</groupId> |
| <artifactId>AbcFileTypeSupport</artifactId> |
| <version>1.0-SNAPSHOT</version> |
| *<packaging>nbm</packaging>* |
| |
| <name>AbcFileTypeSupport</name> |
| |
| <properties> |
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| </properties> |
| |
| <repositories> |
| <!-- |
| Repository hosting NetBeans modules, especially APIs. |
| Versions are based on IDE releases, e.g.: RELEASE691 |
| To create your own repository, use: nbm:populate-repository |
| --> |
| <repository> |
| <id>netbeans</id> |
| <name>NetBeans</name> |
| <url>http://bits.netbeans.org/maven2/</url> |
| <snapshots> |
| <enabled>false</enabled> |
| </snapshots> |
| </repository> |
| </repositories> |
| |
| <dependencies> |
| <dependency> |
| <groupId>org.netbeans.api</groupId> |
| <artifactId>org-netbeans-api-annotations-common</artifactId> |
| <version>RELEASE71-BETA</version> |
| </dependency> |
| </dependencies> |
| |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.codehaus.mojo</groupId> |
| *<artifactId>nbm-maven-plugin</artifactId>* |
| <version>3.6</version> |
| <extensions>true</extensions> |
| </plugin> |
| |
| <plugin> |
| <!-- NetBeans 6.9+ requires JDK 6 --> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-compiler-plugin</artifactId> |
| <version>2.3.2</version> |
| <configuration> |
| <source>1.6</source> |
| <target>1.6</target> |
| </configuration> |
| </plugin> |
| |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| *<artifactId>maven-jar-plugin</artifactId>* |
| <version>2.3.1</version> |
| <configuration> |
| <!-- to have the jar plugin pickup the nbm generated manifest --> |
| <useDefaultManifestFile>true</useDefaultManifestFile> |
| </configuration> |
| </plugin> |
| </plugins> |
| </build></code></pre> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_recognizing_the_file_type"><a class="anchor" href="#_recognizing_the_file_type"></a>Recognizing the File Type</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>In this section you will use the New File Type wizard to create the files for recognizing a new file type named <code>.abc</code> .</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="1"> |
| <li> |
| <p>Right-click the project node in the Projects window and choose New > File Type. Click Next.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="2"> |
| <li> |
| <p>In the File Recognition panel, type <strong>text/x-abc</strong> for the MIME Type and <strong>.abc .ABC</strong> for the Filename Extension:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/maven-single_71_pic5.png" alt="maven single 71 pic5"> |
| </div> |
| <div class="title">Figure 4. Module wizard 1</div> |
| </div> |
| <div class="paragraph"> |
| <p>Click Next.</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="3"> |
| <li> |
| <p>Type <strong>Abc</strong> as the Class Name Prefix. Click Browse and select a 16x16 pixel image file as the new file type’s icon.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="paragraph"> |
| <p>If you don’t have an image available, just save this image <code> <a href="images/maven-crud_abc16.png">abc16.png</a></code> (<span class="image"><img src="../../_images/tutorials/maven-crud_abc16.png" alt="maven crud abc16" title="16x16"></span>) to your system and select the image after clicking Browse.</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/maven-single_71_pic6.png" alt="maven single 71 pic6"> |
| </div> |
| <div class="title">Figure 5. Module wizard 1</div> |
| </div> |
| <div class="paragraph"> |
| <p>Click Finish.</p> |
| </div> |
| <div class="paragraph"> |
| <p>When you click Finish, the IDE creates the files shown below:</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/maven-single_71_pic7.png" alt="maven single 71 pic7"> |
| </div> |
| <div class="title">Figure 6. Module wizard 1</div> |
| </div> |
| <div class="paragraph"> |
| <p>For more details on the files that the IDE created, see <a href="../../../../wiki/main/netbeansdevelopperfaq/DevFaqDataObject/" class="xref page">What is a DataObject</a> and the section on <a href="../nbm-filetype/#recognizing" class="xref page">Recognizing Abc Files</a> in the Ant-Based <a href="../nbm-filetype/" class="xref page">File Type Integration Tutorial</a>.</p> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_building_and_running_the_project"><a class="anchor" href="#_building_and_running_the_project"></a>Building and Running the Project</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>To install the module, you first need to build and run it.</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="1"> |
| <li> |
| <p>Right-click the project node and choose Build.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="2"> |
| <li> |
| <p>Right-click the project node and choose Run. The IDE launches with the new module installed. To confirm that the new module is working correctly, create a new project and then use the New File wizard to create an <code>abc</code> file:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/maven-single_71_pic8.png" alt="maven single 71 pic8"> |
| </div> |
| <div class="title">Figure 7. Module wizard 1</div> |
| </div> |
| <div class="paragraph"> |
| <p>For example, you can create a simple Java application and then open the New File wizard and choose the Empty Abc file type in the Other category.</p> |
| </div> |
| <div class="paragraph"> |
| <p>When you create the new file, specify a source package if you want to see the file in the Projects window. By default the wizard for the new file type will create the file at the root level of the project.</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="3"> |
| <li> |
| <p>After you create the new abc file you can see that the file is displayed in the Projects window with the icon for the file type. If you open the file in the editor you can see that the contents of the new file were generated from the file template.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/maven-single_71_pic9.png" alt="maven single 71 pic9"> |
| </div> |
| <div class="title">Figure 8. Module wizard 1</div> |
| </div> |
| <div class="paragraph"> |
| <p>Click the "Visual" tab and you will see the GUI panel created by the New File Type wizard:</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/maven-single_71_pic91.png" alt="maven single 71 pic91"> |
| </div> |
| <div class="title">Figure 9. Module wizard 1</div> |
| </div> |
| <div class="paragraph"> |
| <p>You can see that your file type is now recognized by the application. In the next section, we’ll create a new action for our file type, which will be available when the user right-click on a file conforming to the type in the Projects window.</p> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_adding_an_action_for_the_file_type"><a class="anchor" href="#_adding_an_action_for_the_file_type"></a>Adding an Action for the File Type</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>In this section you will add an action that can be invoked from the popup menu when the user right-clicks the node of a file conforming to your new file type.</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="1"> |
| <li> |
| <p>Right-click the AbcFileTypeSupport project and choose New > Action. In the Action Type panel, select Conditionally Enabled and type <strong>AbcDataObject</strong> for the Cookie Class, which specifies the type that needs to be in the Lookup for the Action to be enabled:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/maven-single_71_pic92.png" alt="maven single 71 pic92"> |
| </div> |
| <div class="title">Figure 10. Module wizard 1</div> |
| </div> |
| <div class="paragraph"> |
| <p>Click Next.</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="2"> |
| <li> |
| <p>Select Edit in the Category drop-down list and deselect Global Menu Item. Select File Type Context Menu Item and select <strong>text/x-abc</strong> in the Content Type drop-down list:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/maven-single_71_pic93.png" alt="maven single 71 pic93"> |
| </div> |
| <div class="title">Figure 11. Module wizard 1</div> |
| </div> |
| <div class="paragraph"> |
| <p>Click Next.</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="3"> |
| <li> |
| <p>Type <strong>MyAction</strong> as the Class Name and <strong>My Action</strong> as the Display Name:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/maven-single_71_pic94.png" alt="maven single 71 pic94"> |
| </div> |
| <div class="title">Figure 12. Module wizard 1</div> |
| </div> |
| <div class="paragraph"> |
| <p>Click Finish.</p> |
| </div> |
| <div class="paragraph"> |
| <p>When you click Finish, <code>MyAction.java</code> is created in the <code>com.mycompany.abcfiletype</code> source package:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">package com.mycompany.abcfiletypesupport; |
| |
| import java.awt.event.ActionEvent; |
| import java.awt.event.ActionListener; |
| import org.openide.awt.ActionID; |
| import org.openide.awt.ActionReference; |
| import org.openide.awt.ActionReferences; |
| import org.openide.awt.ActionRegistration; |
| import org.openide.util.NbBundle.Messages; |
| |
| @ActionID(category = "Edit", |
| id = "com.mycompany.abcfiletypesupport.MyAction") |
| @ActionRegistration(displayName = "#CTL_MyAction") |
| @ActionReferences({ |
| @ActionReference(path = "Loaders/text/x-abc/Actions", position = 0) |
| }) |
| @Messages("CTL_MyAction=My Action") |
| public final class MyAction implements ActionListener { |
| |
| private final AbcDataObject context; |
| |
| public MyAction(AbcDataObject context) { |
| this.context = context; |
| } |
| |
| public void actionPerformed(ActionEvent ev) { |
| // TODO use context |
| } |
| |
| }</code></pre> |
| </div> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="4"> |
| <li> |
| <p>Let’s now make the Action a bit more meaningful. We’ll add some code for the action. In this example you will add some code that uses <code>DialogDisplayer</code> to open a dialog box when the action is invoked from the popup menu.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="paragraph"> |
| <p>Modify the <code>actionPerformed(ActionEvent ev)</code> method in <code>MyAction.java</code> to open a dialog when My Action is invoked.</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@Override |
| public void actionPerformed(ActionEvent ev) { |
| *FileObject f = context.getPrimaryFile(); |
| String displayName = FileUtil.getFileDisplayName(f); |
| String msg = "This file is " + displayName + "."; |
| NotifyDescriptor nd = new NotifyDescriptor.Message(msg); |
| DialogDisplayer.getDefault().notify(nd);* |
| }</code></pre> |
| </div> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="5"> |
| <li> |
| <p>Fix the missing import statements (Ctrl-Shift-I) and then confirm that your import statements are as shown below:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">package com.mycompany.abcfiletypesupport; |
| |
| import java.awt.event.ActionEvent; |
| import java.awt.event.ActionListener; |
| import org.openide.DialogDisplayer; |
| import org.openide.NotifyDescriptor; |
| import org.openide.awt.ActionID; |
| import org.openide.awt.ActionReference; |
| import org.openide.awt.ActionReferences; |
| import org.openide.awt.ActionRegistration; |
| import org.openide.filesystems.FileObject; |
| import org.openide.filesystems.FileUtil; |
| import org.openide.util.NbBundle.Messages; |
| |
| @ActionID(category = "Edit", |
| id = "com.mycompany.abcfiletypesupport.MyAction") |
| @ActionRegistration(displayName = "#CTL_MyAction") |
| @ActionReferences({ |
| @ActionReference(path = "Loaders/text/x-abc/Actions", position = 0) |
| }) |
| @Messages("CTL_MyAction=My Action") |
| public final class MyAction implements ActionListener { |
| |
| private final AbcDataObject context; |
| |
| public MyAction(AbcDataObject context) { |
| this.context = context; |
| } |
| |
| @Override |
| public void actionPerformed(ActionEvent ev) { |
| FileObject f = context.getPrimaryFile(); |
| String displayName = FileUtil.getFileDisplayName(f); |
| String msg = "This file is " + displayName + "."; |
| NotifyDescriptor nd = new NotifyDescriptor.Message(msg); |
| DialogDisplayer.getDefault().notify(nd); |
| } |
| |
| }</code></pre> |
| </div> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="6"> |
| <li> |
| <p>You can now try out the module to confirm that the new action works correctly.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="paragraph"> |
| <p><strong>Note.</strong> To run the module you will first need to clean and build the module.</p> |
| </div> |
| <div class="paragraph"> |
| <p>When you right-click on a node of the <code>abc</code> file type you will see that My Action is one of the items in the popup menu.</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/maven-single_71_pic95.png" alt="maven single 71 pic95"> |
| </div> |
| <div class="title">Figure 13. Module wizard 1</div> |
| </div> |
| <div class="paragraph"> |
| <p>This tutorial demonstrated how to create and run a NetBeans module that you created from a Maven Archetype. You also learned a little about how to work with file types, but for more details you should look at the Ant-Based <a href="../nbm-filetype/" class="xref page">NetBeans File Type Tutorial</a>. For more examples on how to build NetBeans Platform applications and modules, see the tutorials listed in the <a href="../../kb/docs/platform/" class="xref page">NetBeans Platform Learning Trail</a>.</p> |
| </div> |
| <div class="paragraph"> |
| <p><a href="../../../../front/main/community/mailing-lists/" class="xref page">Send Us Your Feedback</a></p> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_see_also"><a class="anchor" href="#_see_also"></a>See Also</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>For more information about creating and developing applications, see the following resources.</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p><a href="../../kb/docs/platform/" class="xref page">NetBeans Platform Learning Trail</a></p> |
| </li> |
| <li> |
| <p><a href="https://bits.netbeans.org/dev/javadoc/">NetBeans API Javadoc</a></p> |
| </li> |
| </ul> |
| </div> |
| <div class="paragraph"> |
| <p>If you have any questions about the NetBeans Platform, feel free to write to the mailing list, <a href="mailto:users@netbeans.apache.org">users@netbeans.apache.org</a>, or view the <a href="../../../../front/main/community/mailing-lists/" class="xref page">NetBeans Platform mailing list archive</a>.</p> |
| </div> |
| </div> |
| </div> |
| <section class='tools'> |
| <ul class="menu align-center"> |
| <li><a title="Facebook" href="https://www.facebook.com/NetBeans"><i class="fa fa-md fa-facebook"></i></a></li> |
| <li><a title="Twitter" href="https://twitter.com/netbeans"><i class="fa fa-md fa-twitter"></i></a></li> |
| <li><a title="Github" href="https://github.com/apache/netbeans"><i class="fa fa-md fa-github"></i></a></li> |
| <li><a title="YouTube" href="https://www.youtube.com/user/netbeansvideos"><i class="fa fa-md fa-youtube"></i></a></li> |
| <li><a title="Atom Feed" href="https://netbeans.apache.org/blogs/atom"><i class="fa fa-mf fa-rss"></i></a></li> |
| <li><a title="Slack" href="https://tinyurl.com/netbeans-slack-signup/"><i class="fa fa-md fa-slack"></i></a></li> |
| <li><a title="Issues" href="https://github.com/apache/netbeans/issues"><i class="fa fa-mf fa-bug"></i></a></li> |
| </ul> |
| <ul class="menu align-center"> |
| <li><a href="https://github.com/apache/netbeans-antora-tutorials/edit/main/modules/ROOT/pages/tutorials/nbm-maven-modulesingle.adoc" title="See this page in github"><i class="fa fa-md fa-edit"></i> See this page in GitHub.</a></li> |
| </ul> |
| </section> |
| </div> |
| <div class='grid-container incubator-area' style='margin-top: 64px'> |
| <div class='grid-x grid-padding-x'> |
| <div class='large-auto cell text-center'> |
| <a href="https://www.apache.org/"> |
| <img style="height: 60px" title="Apache Software Foundation" src="../../../../_/images/asf_logo_wide.svg" /> |
| </a> |
| </div> |
| <div class='large-auto cell text-center'> |
| <a href="https://www.apache.org/events/current-event.html"> |
| <img style="width:234px; height: 60px;" title="Apache Software Foundation current event" src="https://www.apache.org/events/current-event-234x60.png"/> |
| </a> |
| </div> |
| </div> |
| </div> |
| <footer> |
| <div class="grid-container"> |
| <div class="grid-x grid-padding-x"> |
| <div class="large-auto cell"> |
| <h1><a href="../../../../front/main/about">About</a></h1> |
| <ul> |
| <li><a href="../../../../front/main/community/who">Who's Who</a></li> |
| <li><a href="https://www.apache.org/foundation/thanks.html">Thanks</a></li> |
| <li><a href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li> |
| <li><a href="https://www.apache.org/security/">Security</a></li> |
| </ul> |
| </div> |
| <div class="large-auto cell"> |
| <h1><a href="../../../../front/main/community">Community</a></h1> |
| <ul> |
| <li><a href="../../../../front/main/community/mailing-lists">Mailing lists</a></li> |
| <li><a href="../../../../front/main/community/committer">Becoming a committer</a></li> |
| <li><a href="../../../../front/main/community/events">NetBeans Events</a></li> |
| <li><a href="https://www.apache.org/events/current-event.html">Apache Events</a></li> |
| </ul> |
| </div> |
| <div class="large-auto cell"> |
| <h1><a href="../../../../front/main/participate">Participate</a></h1> |
| <ul> |
| <li><a href="../../../../front/main/participate/submit-pr">Submitting Pull Requests</a></li> |
| <li><a href="../../../../front/main/participate/report-issue">Reporting Issues</a></li> |
| <li><a href="../../../../front/main/participate/#documentation">Improving the documentation</a></li> |
| </ul> |
| </div> |
| <div class="large-auto cell"> |
| <h1><a href="../../../../front/main/help">Get Help</a></h1> |
| <ul> |
| <li><a href="../../../../front/main/help/#documentation">Documentation</a></li> |
| <li><a href="../../../../wiki/main/wiki">Wiki</a></li> |
| <li><a href="../../../../front/main/help/#support">Community Support</a></li> |
| <li><a href="../../../../front/main/help/commercial-support">Commercial Support</a></li> |
| </ul> |
| </div> |
| <div class="large-auto cell"> |
| <h1><a href="../../../../front/main/download">Download</a></h1> |
| <ul> |
| <li><a href="../../../../front/main/download">Releases</a></li> |
| <li><a href="https://plugins.netbeans.apache.org/">Plugins</a></li> |
| <li><a href="../../../../front/main/download/#_daily_builds_and_building_from_source">Building from source</a></li> |
| <li><a href="../../../../front/main/download/#_older_releases">Previous releases</a></li> |
| </ul> |
| </div> |
| </div> |
| </div> |
| </footer> |
| <div class='footer-disclaimer'> |
| <div class="footer-disclaimer-content"> |
| <p>Copyright © 2017-2025 <a href="https://www.apache.org">The Apache Software Foundation</a>.</p> |
| <p>Licensed under the Apache <a href="https://www.apache.org/licenses/">license</a>, version 2.0</p> |
| <div style='max-width: 40em; margin: 0 auto'> |
| <p>Apache, Apache NetBeans, NetBeans, the Apache feather logo and the Apache NetBeans logo are trademarks of <a href="https://www.apache.org">The Apache Software Foundation</a>.</p> |
| <p>Oracle and Java are registered trademarks of Oracle and/or its affiliates.</p> |
| <p>The Apache NetBeans website conforms to the <a href="https://privacy.apache.org/policies/privacy-policy-public.html">Apache Software Foundation Privacy Policy</a></p> |
| </div> |
| </div> |
| </div> |
| |
| |
| <script src="../../../../_/js/vendor/lunr.js"></script> |
| <script src="../../../../_/js/search-ui.js" id="search-ui-script" data-site-root-path="../../../.." data-snippet-length="100" data-stylesheet="../../../../_/css/search.css"></script> |
| <script async src="../../../../search-index.js"></script> |
| <script src="../../../../_/js/vendor/jquery.min.js"></script> |
| <script src="../../../../_/js/vendor/what-input.min.js"></script> |
| <script src="../../../../_/js/vendor/foundation.min.js"></script> |
| <script src="../../../../_/js/vendor/jquery.colorbox-min.js"></script> |
| <script src="../../../../_/js/netbeans.js"></script> |
| <script> |
| $(function(){ $(document).foundation(); }); |
| </script> |
| <script src="../../../../_/js/vendor/highlight.min.js"></script> |
| <script> |
| document.addEventListener('DOMContentLoaded', (event) => { |
| document.querySelectorAll('pre code').forEach((el) => { |
| hljs.highlightElement(el); |
| }); |
| }); |
| </script> |
| </body> |
| </html> |