我正在使用 NetBeans 6.9 Beta,我想完成以下任务:
- 使用 Maven 设置一个代表主应用程序的项目(例如“Maven 项目”、“Maven NetBeans 应用程序”)
- 理想情况下,该项目应仅包含必要的库在 Apache Felix 中运行(我希望能够右键单击该项目并选择“在 Felix 中运行”)
- 我不希望该项目包含所有 NetBean 平台 API
- 我更愿意使用 OSGi 实现这些模块。例如“Maven OSGi Bundle”、“Maven NetBeans Module”+ OSGi
这些是我目前遇到的问题:
- 标准 Maven 原型(“Maven NetBeans 应用程序”)似乎总是选择所有 API,但我还没有找到取消选择 API 的方法 - 在正常的 NetBeans 平台应用程序中,可以通过转到项目属性并取消选择平台模块来完成) - 我想这与 NetBeans 存储库有关(http://bits.netbeans.org/maven2)?我必须创建另一个存储库吗?
- 创建具有 OSGi 支持的普通“NetBeans 模块”时,这些模块同时包含 NetBeans 模块和 OSGi 元数据,这很好。因此,例如 NetBeans 中的工具支持可用于这两种技术。但“Maven NetBeans 模块”仅具有 NetBeans 元数据,而 Maven OSGi 捆绑包仅具有 OSGi 元数据)。
<罢工>3。我弄清楚了如何使用project / new 将模块添加到项目中,然后将模块放置在Maven 项目文件夹中。但是,我还不太清楚如何从其他位置链接到模块(NetBeans 使用 Maven 模块,它必须与项目位于同一目录中?)。
下面是 Maven + OSGi 的一些有用链接NetBeans
wiki.netbeans.org/STS_69_Maven_OSGI NetBeans Maven OSGi 测试规范
platform.netbeans.org/tutorials/nbm-maven-quickstart.html 使用 Maven 的 NetBeans 平台快速入门 (6.9)
wiki.netbeans.org/MavenBestPractices NetBeans Maven BestPractices
maven.apache .org/pom.html#Aggregation Maven 文档多模块项目
(很抱歉缺少协议,但无法发布消息,否则)
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:
- 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?
- 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)
你的nbm-application项目依赖于所有平台项目..只需使用常规的maven依赖管理(添加/删除依赖项,添加依赖项排除来限制你的平台
自己配置nbm插件和bundle插件以顺序将内容附加到清单文件中。我认为Fabrizio Guidici的forceten和bluemarine项目以某种方式做到这一点..
I不完全理解这个问题。maven 模块与 netbeans 模块不同。您肯定可以从多个独立构建的 nb 模块工件组成应用程序。
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
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..
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.