views:

185

answers:

1

I am using NetBeans 6.9 Beta and I would like to accomplish the following:

  • Set up a project representing the main application using Maven (for instance "Maven Project", "Maven NetBeans Application")
  • Ideally, the project should only contain the necessary libraries to run in Apache Felix (I would like to be able to right-click the project and select "Run in Felix")
  • I do not want that the project contains all the NetBean Platform APIs
  • I would prefer to implement the modules using OSGi. For instance "Maven OSGi Bundle", "Maven NetBeans Module" + OSGi

These are the problems, which I have at the moment:

  1. The standard Maven archetype ("Maven NetBeans Application") seems always to select all APIs and I have not found a way to deselect APIs - in normal NetBeans Platform Applications that can be accomplished by going to the project properties and deselected the platform modules) - I guess it has something to do with the NetBeans repository (http://bits.netbeans.org/maven2)? Do I have to create another repository?
  2. When creating normal "NetBeans Module" with OSGi support, the modules contain both NetBeans Module and OSGi meta data, which is nice. So, for instance the tool support in NetBeans is available for both technologies. But the "Maven NetBeans Modules" have only NetBeans meta data and the Maven OSGi Bundles have only OSGi meta data). 3. I figured out how to add modules to the project by using project / new and then placing the modules in the Maven project folder. However, I do not quite know yet how I could link to modules from other locations (NetBeans uses Maven modules, which have to be in the same directory as the project?).

Below some useful links for Maven + OSGi in NetBeans

wiki.netbeans.org/STS_69_Maven_OSGI NetBeans Maven OSGi Test Specification

platform.netbeans.org/tutorials/nbm-maven-quickstart.html NetBeans Platform Quick Start Using Maven (6.9)

wiki.netbeans.org/MavenBestPractices NetBeans Maven BestPractices

maven.apache.org/pom.html#Aggregation Maven Documentation Multi-Module Projects

(sorry about the missing protocol but couldn't post the message otherwise)

+1  A: 
  1. your nbm-application project depends on all platform projects.. just use the regular maven dependency management (adding/removing dependencies, adding dependency excludes to limit your platform

  2. configure the nbm plugin and the bundle plugin yourself to sequentially append content to the manifest file.. I think Fabrizio Guidici's forceten and bluemarine projects do that in some way..

  3. I don't understand the problem entirely. maven modules are a different thing than netbeans modules. you can for sure compose the application from multiple independently build nb module artifacts.

mkleint
1. Thanks, that seems reasonable2. hmm, that seems a good way to create the right modules! But I was more after the tool support in NetBeans (I see the question does not make that quite clear). So, being able eg to create NetBeans Platform API windows by right-clicking on the OSGi module.3. Yep, that question is not too good ...
mxro
2. using netbeans module wizards on osgi bundles is not supported in 6.9. file an issue at netbeans.org
mkleint