Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 167084 - Wrong classpath using project execution
Wrong classpath using project execution
Product: projects
Classification: Unclassified
Component: Maven
All Windows XP
: P3 (vote)
: 6.x
Assigned To: Milos Kleint
Depends on:
  Show dependency treegraph
Reported: 2009-06-15 09:09 UTC by lforet
Modified: 2009-07-20 13:14 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT

Sample project (3.76 KB, application/x-compressed)
2009-06-15 09:11 UTC, lforet

Note You need to log in before you can comment on or make changes to this bug.
Description lforet 2009-06-15 09:09:42 UTC
The problem is when I execute the main class from the project node I have the compile Classpath and not the runtime 
On the contrary when I execute directly fom the file node I have the good runtime classpath.
Example :

From the project node :
mvn.bat -Dexec.args=-classpath %classpath org.laurentforet.runtimecpapi.Service -
Dexec.executable=C:\JIde\jdks\jdk1.5\bin\java.exe -Dnetbeans.execution=true process-classes org.codehaus.mojo:exec-

[INFO] Service - -from Log4j or not Log4j ?

It seems that log4j is not used.

But from the file node (the same command line)
mvn.bat -Dexec.classpathScope=runtime -Dexec.args=-classpath %classpath org.laurentforet.runtimecpapi.Service -
Dexec.executable=C:\JIde\jdks\jdk1.5\bin\java.exe -Dnetbeans.execution=true process-classes org.codehaus.mojo:exec-

INFO [Really using Log4j] Service:9 - from Log4j or not Log4j ?

Here log4j is used.

I will attach my sample project.

Best regards.

Laurent Forêt.
Comment 1 lforet 2009-06-15 09:11:33 UTC
Created attachment 83570 [details]
Sample project
Comment 2 Milos Kleint 2009-06-16 14:46:33 UTC
the workaround is to put 
as a property for the Run/Debug action mappings.

That property of exec-maven-plugin seems to default to "compile" scope which is strange for execution plugin. See
Comment 3 lforet 2009-06-16 15:50:30 UTC
Ok the turnaround work fine.

Thanls Laurent.
Comment 4 Quality Engineering 2009-06-17 08:32:04 UTC
Integrated into 'main-golden', will be available in build *200906170201* on (upload may still be in progress)
User: Milos Kleint <>
Log: #167084 default scope in exec-plugin 1.1.1 is compile, which is wrong, it should be runtime, we need to set in action mapping for now
Comment 5 Jaroslav Pospisil 2009-06-25 16:12:53 UTC
Comment 6 pgebauer 2009-07-02 12:49:27 UTC
The fix has been ported into the release67_fixes repository.
Comment 7 pribyl 2009-07-20 13:14:13 UTC
Product Version: NetBeans IDE 6.7.1 RC (Build 200907162301)
Java: 1.6.0_14; Java HotSpot(TM) Client VM 14.0-b16
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)

Verified in 6.7.1 RC

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