Issue
I have a Netbeans RCP project built using Maven but my build fails during building of one of the modules with the following error line:
--- 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
Could you suggest what can be done about it? I tried adding the org.netbeans.api:org-openide-util-lookup
using dependencies > add
but it cannot be done (it looks like the dependency is already there).
This is the full stack trace fron 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.
Any help is appreciated. I am new to Maven. The project itself looks fine (no errors) before built.
Solution
Ok, I finally figured it out. I will leave the anser here, perhaps it will help somebody in the future...
http://wiki.netbeans.org/Maven_NBM_comments:
There is inconsistence between maven compile dependency tree and the runtime netbeans dependencies.
So basically, you have to manullay add all dependecies related to org.netbeans.api
to the pom.xml
and then it starts to work. The quoted article claimed that this inconsitency may be solved in Maven 3 but sadly, it is not.
Answered By - Smajl
Answer Checked By - Marilyn (JavaFixing Volunteer)