Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException with inlcudePluginDependecies=true #76

Closed
conerck opened this issue Mar 16, 2017 · 7 comments · Fixed by #77
Closed

NullPointerException with inlcudePluginDependecies=true #76

conerck opened this issue Mar 16, 2017 · 7 comments · Fixed by #77
Labels

Comments

@conerck
Copy link

conerck commented Mar 16, 2017

Using mvn 3.3.3
Minimal test case POM (obviously the used dependencies are bogus, but it should be enough to replicate.

<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>test</groupId> <artifactId>PluginDependencies</artifactId> <version>0.1-SNAPSHOT</version> <build> <pluginManagement> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.6.0</version> <executions> <execution> <id>default</id> <goals> <goal>java</goal> </goals> </execution> </executions> <configuration> <executableDependency> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> </executableDependency> <includeProjectDependencies>false</includeProjectDependencies> <includePluginDependencies>true</includePluginDependencies> <mainClass>org.codehaus.mojo.exec.ExecJavaMojo</mainClass> </configuration> <dependencies> <dependency> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.6.0</version> <type>jar</type> </dependency> </dependencies> </plugin> </plugins> </pluginManagement> </build> </project>

This will fail with
` mvn exec:java
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building PluginDependencies 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- exec-maven-plugin:1.6.0:java (default-cli) @ PluginDependencies ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.673 s
[INFO] Finished at: 2017-03-16T11:46:02+01:00
[INFO] Final Memory: 11M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project PluginDependencies: Execution default-cli of goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java failed. NullPointerException -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Picked up _JAVA_OPTIONS: -Xmx2048M

in 1.5.0 this setup worked fine. Obviously with this sample POM the build will still fail because the executableDependency has no mainClass.

jonasrutishauser added a commit to jonasrutishauser/exec-maven-plugin that referenced this issue Mar 22, 2017
1.6.0

Fixes mojohaus#76
A regression was introduced with the following change:
exec mojo can run executableDependency instead of executable (7684096)
@jmini
Copy link

jmini commented Jun 1, 2017

@jonasrutishauser: I can confirm that the version 1.6.1-SNAPSHOT built from your bugfix/NPE-with-includePluginDependencies branch is also working for me. See my example project on GitHub: https://github.com/jmini/exec-maven-plugin_issue_76

Thank you a lot, I hope this will be merged back in the master.

@vasiliy-bout
Copy link

Hi, I use instruction from http://www.mojohaus.org/exec-maven-plugin/examples/example-exec-using-plugin-dependencies.html and still get NullPointerException. When this fix is going to be merged and released?

@thinkerou
Copy link

thinkerou commented May 29, 2018

+1
cc @khmarbaise @jonasrutishauser

I use <exec-maven-plugin.version>1.5.0</exec-maven-plugin.version> it is OK, but use <exec-maven-plugin.version>1.6.0</exec-maven-plugin.version> (ONLY Change version) will have the follow error:

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (generate-scala-protobuf-classes) on project gatling-grpc: Execution generate-scala-protobuf-classes of goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java failed.: NullPointerException -> [Help 1] [ERROR]

thanks a lot!

@jycr
Copy link

jycr commented Jun 28, 2018

Any news about the resolution of this bug?

@masu1402
Copy link

Still not resolved? Can't see any new versions and the bug fix is still in an open branch.

jonasrutishauser added a commit to jonasrutishauser/exec-maven-plugin that referenced this issue Feb 22, 2019
1.6.0

Fixes mojohaus#76
A regression was introduced with the following change:
exec mojo can run executableDependency instead of executable (7684096)
@dwabm
Copy link

dwabm commented Apr 9, 2019

is there a merge an release roadmap for tis fix?

@workcartersmith
Copy link

This is still a thing.

slawekjaranowski pushed a commit to jonasrutishauser/exec-maven-plugin that referenced this issue Jul 12, 2022
1.6.0

Fixes mojohaus#76
A regression was introduced with the following change:
exec mojo can run executableDependency instead of executable (7684096)
slawekjaranowski pushed a commit that referenced this issue Jul 12, 2022
1.6.0

Fixes #76
A regression was introduced with the following change:
exec mojo can run executableDependency instead of executable (7684096)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
9 participants