开发者

Link Maven OSGi to Maven NetBeans Platform Project

开发者 https://www.devze.com 2023-01-01 01:24 出处:网络
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 Applicatio

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/M开发者_运维技巧avenBestPractices 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. 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.

0

精彩评论

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

关注公众号