Netbeans maven add module

In Netbeans, how to add a module to a project with multiple maven modules using the IDE. In Eclipse, I can right-click the project> add> new> other> maven module. Netbeans have a similar feature.

+6
maven netbeans
source share
4 answers

Maven supports the concept of modules, which should not be confused with netbeans modules.

+1
source share

Before in pom.xml, set the packaging as pom for the parent project.

packing pom instead of jar

+1
source share

This does not work with Netbeans 7.0.x

In Netbeans 7.1:

  • Expand (maven) the parent project in the Projects view
  • Choose "Modules" correctly
  • Select "Add Module"
0
source share

Since you use the word β€œmodule”, I suppose you mean the Netbeans Platform module added to the Netbeans platform application?

Here's how to do it (Netbeans IDE v7.1.2):

  • From the File menu, select New Project. Select the Maven category and select Netbeans Module in the right list.

  • Now you are provided with a wizard that will collect various information. The most important thing about your question is Project Location. It is important that you select the parent directory for your application here, so that each module belonging to your application becomes a subdirectory of this parent directory. If your parent application is located in "C: \ JavaDevelopment \ MySuperApp", then you put this in the "Project Location".

Having done this, the new module will automatically be added to your parent application as a dependency. Of course, the module will be autonomous and can, of course, be used in several projects if you like, but for me it most often makes sense to place the module with the application to which it naturally belongs, that is, everything in the same directory tree.

If you prefer to do this in split directory trees, you must manually add the dependency.

-one
source share

All Articles