jose luis romero created NETBEANS-2915:
------------------------------------------

             Summary: Maven execution single file with PSVM throws exception
                 Key: NETBEANS-2915
                 URL: https://issues.apache.org/jira/browse/NETBEANS-2915
             Project: NetBeans
          Issue Type: Bug
          Components: projects - Maven
    Affects Versions: 11.1
         Environment: Windows 10 64, jdk 8
            Reporter: jose luis romero


In a maven desktop project, when I add a PSVM to a file to test things, it may 
work one or maybe 2 times, but after a "clean and build" or any modification to 
the POM, I can't run a single file anymore.

The only workaround that I found is going to the project > Properties > Run > 
and change the Main Class

*This problem is exclusive for Windows, on Linux doesn't happen*
{code:java}
cd D:\NetBeansProjects\Sindicato; "JAVA_HOME=C:\\Program Files\\Java\\jdk1.8" 
M2_HOME=C:\\apache-maven cmd /c "\"\"C:\\apache-maven\\bin\\mvn.cmd\" 
-Dexec.args=\"-classpath %classpath org.sindicato.controller.PlanesController\" 
-Dexec.executable=\"C:\\Program Files\\Java\\jdk1.8\\bin\\java.exe\" 
-Dexec.classpathScope=runtime -DskipTests=true 
-Dmaven.ext.class.path=\"C:\\Program 
Files\\NetBeans-11.1\\netbeans\\java\\maven-nblib\\netbeans-eventspy.jar\" 
-Dfile.encoding=UTF-8 org.codehaus.mojo:exec-maven-plugin:1.5.0:exec\""{code}

Running NetBeans Compile On Save execution. Phase execution is skipped and 
output directories of dependency projects (with Compile on Save turned on) will 
be used instead of their jar artifacts.
Scanning for projects...

 
{code:java}
------------------------------------------------------------------------
Building Sindicato 1
------------------------------------------------------------------------
--- exec-maven-plugin:1.5.0:exec (default-cli) @ sas ---
Error injecting: org.codehaus.mojo.exec.ExecMojo
java.lang.NoClassDefFoundError: org/apache/commons/exec/ProcessDestroyer
 at java.lang.Class.getDeclaredConstructors0 (Native Method)
 at java.lang.Class.privateGetDeclaredConstructors (Class.java:2671)
 at java.lang.Class.getDeclaredConstructors (Class.java:2020)
 at com.google.inject.spi.InjectionPoint.forConstructorOf 
(InjectionPoint.java:245)
 at com.google.inject.internal.ConstructorBindingImpl.create 
(ConstructorBindingImpl.java:99)
 at com.google.inject.internal.InjectorImpl.createUninitializedBinding 
(InjectorImpl.java:658)
 at com.google.inject.internal.InjectorImpl.createJustInTimeBinding 
(InjectorImpl.java:882)
 at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive 
(InjectorImpl.java:805)
 at com.google.inject.internal.InjectorImpl.getJustInTimeBinding 
(InjectorImpl.java:282)
 at com.google.inject.internal.InjectorImpl.getBindingOrThrow 
(InjectorImpl.java:214)
 at com.google.inject.internal.InjectorImpl.getProviderOrThrow 
(InjectorImpl.java:1006)
 at com.google.inject.internal.InjectorImpl.getProvider (InjectorImpl.java:1038)
 at com.google.inject.internal.InjectorImpl.getProvider (InjectorImpl.java:1001)
 at com.google.inject.internal.InjectorImpl.getInstance (InjectorImpl.java:1051)
 at org.eclipse.sisu.space.AbstractDeferredClass.get 
(AbstractDeferredClass.java:48)
 at com.google.inject.internal.ProviderInternalFactory.provision 
(ProviderInternalFactory.java:81)
 at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision 
(InternalFactoryToInitializableAdapter.java:53)
 at com.google.inject.internal.ProviderInternalFactory$1.call 
(ProviderInternalFactory.java:65)
 at 
com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision 
(ProvisionListenerStackCallback.java:115)
 at 
com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision 
(ProvisionListenerStackCallback.java:133)
 at com.google.inject.internal.ProvisionListenerStackCallback.provision 
(ProvisionListenerStackCallback.java:68)
 at com.google.inject.internal.ProviderInternalFactory.circularGet 
(ProviderInternalFactory.java:63)
 at com.google.inject.internal.InternalFactoryToInitializableAdapter.get 
(InternalFactoryToInitializableAdapter.java:45)
 at com.google.inject.internal.InjectorImpl$2$1.call (InjectorImpl.java:1016)
 at com.google.inject.internal.InjectorImpl.callInContext 
(InjectorImpl.java:1092)
 at com.google.inject.internal.InjectorImpl$2.get (InjectorImpl.java:1012)
 at org.eclipse.sisu.inject.Guice4$1.get (Guice4.java:162)
 at org.eclipse.sisu.inject.LazyBeanEntry.getValue (LazyBeanEntry.java:81)
 at org.eclipse.sisu.plexus.LazyPlexusBean.getValue (LazyPlexusBean.java:51)
 at org.codehaus.plexus.DefaultPlexusContainer.lookup 
(DefaultPlexusContainer.java:263)
 at org.codehaus.plexus.DefaultPlexusContainer.lookup 
(DefaultPlexusContainer.java:255)
 at 
org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo 
(DefaultMavenPluginManager.java:519)
 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
(DefaultBuildPluginManager.java:121)
 at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
(MojoExecutor.java:208)
 at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
(MojoExecutor.java:154)
 at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
(MojoExecutor.java:146)
 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
(LifecycleModuleBuilder.java:117)
 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
(LifecycleModuleBuilder.java:81)
 at 
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
 (SingleThreadedBuilder.java:51)
 at org.apache.maven.lifecycle.internal.LifecycleStarter.execute 
(LifecycleStarter.java:128)
 at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
 at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
 at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
 at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
 at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
 at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
 at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke 
(NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke 
(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke (Method.java:498)
 at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced 
(Launcher.java:289)
 at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
 at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode 
(Launcher.java:415)
 at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.ClassNotFoundException: 
org.apache.commons.exec.ProcessDestroyer
 at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass 
(SelfFirstStrategy.java:50)
 at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass 
(ClassRealm.java:271)
 at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass 
(ClassRealm.java:247)
 at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass 
(ClassRealm.java:239)
 at java.lang.Class.getDeclaredConstructors0 (Native Method)
{code}
 

 
{code:java}
BUILD FAILURE
------------------------------------------------------------------------
Total time: 1.554 s
Finished at: 2019-07-29T14:04:56-03:00
Final Memory: 11M/150M
------------------------------------------------------------------------
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:exec 
(default-cli) on project sas: Execution default-cli of goal 
org.codehaus.mojo:exec-maven-plugin:1.5.0:exec failed: A required class was 
missing while executing org.codehaus.mojo:exec-maven-plugin:1.5.0:exec: 
org/apache/commons/exec/ProcessDestroyer
-----------------------------------------------------
realm = plugin>org.codehaus.mojo:exec-maven-plugin:1.5.0
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = 
file:/C:/Users/JoseLuis/.m2/repository/org/codehaus/mojo/exec-maven-plugin/1.5.0/exec-maven-plugin-1.5.0.jar
urls[1] = 
file:/C:/Users/JoseLuis/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.jar
urls[2] = 
file:/C:/Users/JoseLuis/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
urls[3] = 
file:/C:/Users/JoseLuis/.m2/repository/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.jar
urls[4] = 
file:/C:/Users/JoseLuis/.m2/repository/org/slf4j/jcl-over-slf4j/1.5.6/jcl-over-slf4j-1.5.6.jar
urls[5] = 
file:/C:/Users/JoseLuis/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.2.1/maven-reporting-api-2.2.1.jar
urls[6] = 
file:/C:/Users/JoseLuis/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.1/doxia-sink-api-1.1.jar
urls[7] = 
file:/C:/Users/JoseLuis/.m2/repository/org/apache/maven/doxia/doxia-logging-api/1.1/doxia-logging-api-1.1.jar
urls[8] = 
file:/C:/Users/JoseLuis/.m2/repository/commons-cli/commons-cli/1.2/commons-cli-1.2.jar
urls[9] = 
file:/C:/Users/JoseLuis/.m2/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
urls[10] = 
file:/C:/Users/JoseLuis/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
urls[11] = 
file:/C:/Users/JoseLuis/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
urls[12] = 
file:/C:/Users/JoseLuis/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.20/plexus-utils-3.0.20.jar
urls[13] = 
file:/C:/Users/JoseLuis/.m2/repository/org/apache/commons/commons-exec/1.3/commons-exec-1.3.jar
Number of foreign imports: 1
import: Entry[import from realm ClassRealm[maven.api, parent: null]]{code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to