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 191374

Summary: Maven complains about NoClassDefFoundError when environment variable M2_HOME specified
Product: projects Reporter: johnsonlau <johnsonlau>
Component: MavenAssignee: Jesse Glick <jglick>
Status: RESOLVED FIXED    
Severity: normal CC: edvicif, pjiricka
Priority: P3 Keywords: NETFIX
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Remove M2_HOME from mvn's executing environment

Description johnsonlau 2010-10-26 16:42:51 UTC
Maven's startup script (mvn/mvn.bat) uses M2_HOME as the default HOME directory when specified.

It causes NoClassDefFoundError when startup script's major version doesn't consist with the one of default Maven directory, as the filename of the bootstrap jar has been changed since Maven 2.2.1 (classworlds-1.1.jar) to Maven 3 (plexus-classworlds-2.2.3.jar).

Clearly, it will stop NB's upcoming version from calling Maven when user still keeps this environment variable for some reason since NB will come with the latest Maven 3.

M2_HOME should be exclused when NB calls Maven's startup script.
Comment 1 johnsonlau 2010-10-26 17:03:08 UTC
Created attachment 102649 [details]
Remove M2_HOME from mvn's executing environment

Consider Windows is case-insensitive, removes M2_HOME in an iteration and regarding cases.
Comment 2 Jesse Glick 2010-10-26 20:16:16 UTC
*** Bug 189898 has been marked as a duplicate of this bug. ***
Comment 3 Jesse Glick 2010-10-26 20:17:16 UTC
Thanks! Committed with minor modifications: core-main #4b9fc7550193
Comment 4 Quality Engineering 2010-10-28 02:55:13 UTC
Integrated into 'main-golden', will be available in build *201010280000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/4b9fc7550193
User: Jesse Glick <jglick@netbeans.org>
Log: #191374: $M2_HOME would interfere w/ command execution.
Comment 5 Jesse Glick 2010-11-10 18:25:42 UTC
*** Bug 191780 has been marked as a duplicate of this bug. ***