在运行时期间不存在Maven传递依赖项

Sma*_*ajl 4 maven

我有一个使用Maven构建的Netbeans RCP项目,但在构建其中一个模块时,我的构建失败,出现以下错误行:

--- nbm-maven-plugin:3.13:manifest (default-manifest) @ FNApi ---
NBM Plugin generates manifest
Project uses classes from transitive module org.netbeans.api:org-openide-util:jar:RELEASE80 which will not be accessible at runtime.
    To fix the problem, add this module as direct dependency. For OSGi bundles that are supposed to be wrapped in NetBeans modules, use the useOSGiDependencies=false parameter
Project uses classes from transitive module org.netbeans.api:org-openide-util-lookup:jar:RELEASE80 which will not be accessible at runtime.
    To fix the problem, add this module as direct dependency. For OSGi bundles that are supposed to be wrapped in NetBeans modules, use the useOSGiDependencies=false parameter
Run Code Online (Sandbox Code Playgroud)

你能说一下可以做些什么吗?我尝试添加org.netbeans.api:org-openide-util-lookup使用dependencies > add但它无法完成(看起来依赖已经存在).

这是Netbeans的完整堆栈跟踪:

--- nbm-maven-plugin:3.13:manifest (default-manifest) @ FNApi ---
NBM Plugin generates manifest
Project uses classes from transitive module org.netbeans.api:org-openide-util:jar:RELEASE80 which will not be accessible at runtime.
    To fix the problem, add this module as direct dependency. For OSGi bundles that are supposed to be wrapped in NetBeans modules, use the useOSGiDependencies=false parameter
Project uses classes from transitive module org.netbeans.api:org-openide-util-lookup:jar:RELEASE80 which will not be accessible at runtime.
    To fix the problem, add this module as direct dependency. For OSGi bundles that are supposed to be wrapped in NetBeans modules, use the useOSGiDependencies=false parameter
------------------------------------------------------------------------
Reactor Summary:

FNSD-maven-parent ................................. SUCCESS [0.563s]
FNSD-maven-branding ............................... SUCCESS [1.695s]
FNSD-maven-app .................................... SUCCESS [14.645s]
WidgetAPI ......................................... SUCCESS [2.468s]
FNApi ............................................. FAILURE [1.304s]
Browser ........................................... SKIPPED
FlamingoIntegration ............................... SKIPPED
FNCore ............................................ SKIPPED
NetDesigner ....................................... SKIPPED
DST ............................................... SKIPPED
Production ........................................ SKIPPED
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 21.553s
Finished at: Thu Jul 24 11:33:20 CEST 2014
Final Memory: 20M/247M
------------------------------------------------------------------------
Failed to execute goal org.codehaus.mojo:nbm-maven-plugin:3.13:manifest (default-manifest) on project FNApi: See above for failures in runtime NetBeans dependencies verification. -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
Run Code Online (Sandbox Code Playgroud)

任何帮助表示赞赏.我是Maven的新手.在构建之前,项目本身看起来很好(没有错误).

Sma*_*ajl 8

好吧,我终于明白了.我将离开这里的anser,也许它将来会帮助某人...

http://wiki.netbeans.org/Maven_NBM_comments:

maven编译依赖关系树和运行时netbeans依赖关系之间存在不一致.

所以基本上,你必须manullay添加与所有依赖条件org.netbeans.apipom.xml,然后开始工作.引用的文章声称这种不一致可能在Maven 3中得到解决,但遗憾的是,事实并非如此.