This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 188959 - Option to use embedded Maven by default
Summary: Option to use embedded Maven by default
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.0
Hardware: All All
: P1 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
: 165635 169504 180769 (view as bug list)
Depends on: 188913
Blocks:
  Show dependency tree
 
Reported: 2010-07-26 15:41 UTC by Jesse Glick
Modified: 2012-02-07 18:57 UTC (History)
5 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2010-07-26 15:41:16 UTC
Currently the Options dialog lets you set an external Maven home, but will use embedded Maven for execution if:

1. No external home is specified and mvn cannot be found in $PATH.

or

2. The project requests it, in a checkbox in the Actions panel.

In either case, a warning dialog is displayed that the embedded Maven might be unstable, since in previous releases we were embedding an unreleased snapshot.

When we embed the final version of Maven 3.0, this policy should be reconsidered, as embedded execution _might_ be as reliable as external execution. Then again, there might still be class loading issues which make it problematic.

Another option would be to used the JARs from the embedded Maven but fork the Java process. M3 does not seem to use the ClassWorlds "überjar" so we could perhaps bundle a complete M3 distribution inside NB. This would remove a code path (see bug #188913) while permitting people to build Maven projects out of the box. (Though without possible performance benefits of in-process execution; compare http://shell.sonatype.org/ which might give the best of both worlds.)
Comment 1 Jesse Glick 2010-07-26 20:06:57 UTC
(In reply to comment #0)
> Another option would be to used the JARs from the embedded Maven but fork the
> Java process. M3 does not seem to use the ClassWorlds "überjar" so we could
> perhaps bundle a complete M3 distribution inside NB.

In fact it seems it is possible to use the existing layout! Create

---%<--- .../m3.conf
main is org.apache.maven.cli.MavenCli from plexus.core
[plexus.core]
load ${maven.home}/*.jar
---%<---

and run

java -cp .../java/modules/ext/maven/plexus-classworlds-2.2.3.jar -Dclassworlds.conf=.../m3.conf -Dmaven.home=.../java/modules/ext/maven org.codehaus.plexus.classworlds.launcher.Launcher <usual args...>

and it seems to work fine. Of course this is not loading ~/.mavenrc etc., which might be significant for some users.

Simpler would however be to rearrange the JARs NB uses into the standard layout. Need to be careful since NB uses a patched version of xbean-reflect-3.4.jar.
Comment 2 Jesse Glick 2010-07-27 22:49:48 UTC
(In reply to comment #0)
> use the JARs from the embedded Maven but fork the Java process

core-main #6aeef20f698d
Comment 3 Jesse Glick 2010-07-28 15:02:10 UTC
*** Bug 165635 has been marked as a duplicate of this bug. ***
Comment 4 Jesse Glick 2010-07-28 15:41:54 UTC
*** Bug 180769 has been marked as a duplicate of this bug. ***
Comment 5 Jesse Glick 2010-08-02 19:24:46 UTC
*** Bug 169504 has been marked as a duplicate of this bug. ***
Comment 6 Quality Engineering 2010-08-25 03:28:57 UTC
Integrated into 'main-golden', will be available in build *201008250001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/6aeef20f698d
User: Jesse Glick <jglick@netbeans.org>
Log: #188959: disable embedded Maven executor; use bundled Maven installation by default rather than checking $PATH.