开发者

Netbeans maven add module

In Netbeans, how to add a module to a mu开发者_运维技巧lti module maven project using the IDE. In Eclipse I can right click project > add > new > other > maven module. Does netbeans have a similar feature.


Maven supports the concept of modules not to be confused with netbeans modules.


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

packaging pom instead of jar


This does not work with Netbeans 7.0.x

In Netbeans 7.1:

  • Expand (maven) parent project in "Projects" view
  • Right select "Modules"
  • Select "Add module"


Since you use the word "module" I suppose you mean a Netbeans Platform module being added to a Netbeans Platform application ?

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

  1. From the File menu choose "New Project". Choose category "Maven" and from the right-hand list choose "Netbeans Module".

  2. You are now presented with a Wizard that will collect various information. The most important one in relation to your question is "Project Location". It is of importance that you choose the parent directory for your application here so that each module that belongs to your application becomes a sub-directory of this parent directory. If your parent application lives in "C:\JavaDevelopment\MySuperApp" then that is what you put into "Project Location".

By doing it the above way the new module will automatically be added to your parent application as a dependency. The module will of course be autonomous and can of course be used in several projects if you like but for me it most often makes sense to put the module with the application to which it naturally belongs, i.e. everything in same directory tree.

If you prefer to do it in separated directory trees then you must add the dependency manually.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜