Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 205865 - nbm-maven-plugin fails to load due to missing plexus-utils-1.1.jar
nbm-maven-plugin fails to load due to missing plexus-utils-1.1.jar
Status: RESOLVED WONTFIX
Product: apisupport
Classification: Unclassified
Component: Maven
7.1
PC Linux
: P2 (vote)
: TBD
Assigned To: Jesse Glick
issues@apisupport
: REGRESSION
: 206334 (view as bug list)
Depends on: 208211
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-02 17:43 UTC by Jesse Glick
Modified: 2012-09-17 16:34 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2011-12-02 17:43:00 UTC
With an empty local repo, create & build an nbm-packaging project using the 3.6 plugin, and open in the IDE. In 7.0, it looks fine. In 7.1 beta, it is marked unloadable; the reason given is that plexus-utils-1.1.jar is missing. This JAR is not actually a dependency of the plugin at all (it uses plexus-utils-3.0.jar, which is in the local repo); org.apache.maven.plugin.internal.PlexusUtilsInjector is however injecting it into the realm, because for some reason plugin.getDependencies() (in DefaultPluginDependenciesResolver.resolve) is empty during the IDE's project build.

No easy workaround, since building the project from the command line succeeds; have to somehow get this JAR downloaded.
Comment 1 Jesse Glick 2011-12-02 19:23:28 UTC
Actually it is fine that plugin.dependencies=[]; it is repoSystem.collectDependencies() which fails.
Comment 2 Jesse Glick 2011-12-02 20:20:03 UTC
DefaultArtifactDescriptorReader has a problem with the nbm-maven-plugin POM, due to <systemPath> of tasks.jar:

"1 problem was encountered while building the effective model for org.codehaus.mojo:nbm-maven-plugin:3.6
[ERROR] 'dependencies.dependency.systemPath' for org.netbeans.nbbuild:tasks:jar must specify an absolute path but is ${project.basedir}/target/tasks.jar @ 
"

But in CLI usage the ModelBuildingException is not thrown - model.getDependencies() is of length 17; inside the IDE, it is of length 18, because this system dep is included. That is because the netbeans-tasks-jar profile is activated. Indeed trying to build an NBM passing -Dnetbeans.execution=true on the command line fails!

(Not sure why it works in 7.0; perhaps profiles were not being correctly handled during project building? ${netbeans.execution} was set in 7.0.)
Comment 3 Jesse Glick 2011-12-02 21:52:16 UTC
Mojo revision 15474 should prevent this problem for nbm-maven-plugin 3.7. Not sure I can/should do anything here; all I can think to do is to cease to define netbeans.execution for in-IDE parsing, but this could cause problems for users relying on that property. The real problem is with the plugin's deployed POM, which cannot be corrected retroactively.

Anyway a workaround is available: somehow get plexus-utils 1.1 locally.
Comment 4 Jesse Glick 2011-12-13 15:26:28 UTC
*** Bug 206334 has been marked as a duplicate of this bug. ***
Comment 5 Jesse Glick 2011-12-13 15:27:37 UTC
Easiest workaround (needed once per local repo):

mvn -f $yourproj/pom.xml -Dnetbeans.execution=true validate
Comment 6 Geertjan Wielenga 2012-09-14 09:46:41 UTC
On Windows, NetBeans IDE 7.2, I solved this by adding this to the application POM:

    <dependency>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-utils</artifactId>
        <version>1.1</version>
        <scope>runtime</scope>
    </dependency>
Comment 7 Jesse Glick 2012-09-14 13:21:12 UTC
Better to just update to version 3.7 or later of the plugin.
Comment 8 Geertjan Wielenga 2012-09-17 15:37:05 UTC
I'm using 7.2, which means I'm using 3.8 of the plugin. Same problem as described here.
Comment 9 Jesse Glick 2012-09-17 16:34:23 UTC
If you are using version 3.8 of the plugin then you are seeing a different bug and you need to file it.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo