Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: NB_1.0
-
Fix Version/s: NB_1.1
-
Component/s: mevenide-netbeans
-
Labels:None
-
Environment:MacOS 10.4.8, Java 5.0, NetBeans 5.5
-
Number of attachments :
Description
When I try to execute any goal in my Maven project, I get an NPE from Netbeans:
java.lang.NullPointerException
at org.mevenide.netbeans.project.exec.MavenJavaExecutor.createProcess(MavenJavaExecutor.java:138)
at org.mevenide.netbeans.project.exec.MavenJavaExecutor.run(MavenJavaExecutor.java:283)
[catch] at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:131)
Lines 135..138 in MavenJavaExecutor are
File lib = new File(mavenHome, "lib");
String forehead = null;
File[] lbs = lib.listFiles();
for (int i = 0; i < lbs.length; i++) {
so I think that lbs is coming out null because lib doesn't refer to an actual directory. Needs a check in the code to avoid the NPE.
lib is probably wrong because mavenHome is wrong. The code doesn't check that mavenHome actually exists. I've had serious grief with getting Mevenide to recognize the MAVEN_HOME setting since upgrading from NB5.0 to NB5.5, so there might be another bug around here somewhere.
that's could be caused by the fact that mevenide relies on presence of System.getProperty("Env-MAVEN_HOME") property (which was always set by previous release of netbeans when the IDE started according to the environment variable. From your report it seems it's not doing it any more..
a possible workaround could be to start the ide with the -J-DEnv-MAVEN_HOME=<path> command line switch.. or to put the same value into the netbeans/etc/netbeans.conf file