我正在研究由几个模块组成的maven netbeans平台项目。我需要依赖一些模块(比如java.source模块),但是当我尝试运行应用程序时,它报告说,没有安装所需的模块。尽管我依赖于在我的pom.xml中声明的java.source
,但事件仍然存在我想,我必须以某种方式告诉maven,在我的模块加载之前在最终组装的应用程序中安装(并打开)这些模块。
我怎么能这样做?
更新
当我尝试从maven工件创建完整的netbeans应用程序项目并将Java Source API作为依赖项添加到pom.xml中...当我运行应用程序时,会出现以下消息的窗口:
Warning - could not install some modules: Editor Library 2 - None of the modules providing the capability org.netbeans.modules.editor.actions could be installed. Editor Indentation for Projects - The module named org.netbeans.modules.editor.settings.storage/1 was needed and not found. Editor Indentation for Projects - The module named org.netbeans.modules.options.editor/1 was needed and not found. Project UI API - No module providing the capability org.netbeans.modules.project.uiapi.ActionsFactory could be found. Project UI API - No module providing the capability org.netbeans.modules.project.uiapi.OpenProjectsTrampoline could be found. Project UI API - No module providing the capability org.netbeans.modules.project.uiapi.ProjectChooserFactory could be found. Editor Error Stripe Impl - The module named org.netbeans.modules.editor.errorstripe.api/1 was needed and not found. Java Source - The module named org.netbeans.libs.javacimpl/1 was needed and not found. Java Source - The module named org.netbeans.modules.editor.indent.project/0-1 was needed and not found. Java Source - The module named org.netbeans.modules.java.preprocessorbridge was needed and not found. Java Source - The module named org.netbeans.modules.options.editor/1 was needed and not found. Java Source - The module named org.netbeans.modules.parsing.api/1 was needed and not found. Editor Settings - No module providing the capability org.netbeans.api.editor.settings.implementation could be found. Diff - The module named org.netbeans.modules.options.editor/1 was needed and not found. 11 further modules could not be installed due to the above problems.
答案 0 :(得分:2)
最简单的方法是获取一个它抱怨的类,比如说“org.netbeans.modules.editor.actions”,然后转到Add Dependencies并将其插入Query字段。 从那里你应该能够分辨出你需要包含哪个模块
答案 1 :(得分:2)
错误消息“模块依赖项具有朋友依赖性[...]但未列为朋友”意味着您需要指定org.netbeans.modules.options.editor的实现版本。 您可以通过编辑src / main / nbm / module.xml来包含以下条目来实现这一点(我没有在这里使用实际需要的值。确保找出要为id和explicitValue输入的值以满足依赖项(您可以在下面链接的文章中找到解释/说明:
<dependencies>
<dependency>
<id>org.netbeans.modules:org-netbeans-modules-editor</id>
<type>impl</type>
<explicitValue>org.netbeans.modules.editor/1 = 201107282000</explicitValue>
</dependency>
</dependencies>
我很确定以下文章将解释一些问题,并帮助您找到id和explicitValue所需的值(语言是英语,作者是我):
我目前在申请时遇到相关问题,所以我可能会在一段时间内找到更具体的解决方案。