You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "jira-importer (via GitHub)" <gi...@apache.org> on 2025/02/01 20:31:10 UTC

[I] [MJLINK-4] NPE on execution [maven-jlink-plugin]

jira-importer opened a new issue, #248:
URL: https://github.com/apache/maven-jlink-plugin/issues/248

   **[Johannes Boesl](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=j.boesl)** opened **[MJLINK-4](https://issues.apache.org/jira/browse/MJLINK-4?redirect=false)** and commented
   
   When I try to run my maven build I get the following exception:
   
   ```
   [ERROR] Failed to execute goal org.apache.maven.plugins:maven-jlink-plugin:3.0.0-alpha-1:jlink (default-jlink) on project jloadr-jre: Execution default-jlink of goal org.apache.maven.plugins:maven-jlink-plugin:3.0.0-alpha-1:jlink failed.: NullPointerException -> [Help 1]
   org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-jlink-plugin:3.0.0-alpha-1:jlink (default-jlink) on project jloadr-jre: Execution default-jlink of goal org.apache.maven.plugins:maven-jlink-plugin:3.0.0-alpha-1:jlink failed.
   	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
   	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.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:200)
   	at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:196)
   	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
   	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
   	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
   	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
   	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
   	at java.base/java.lang.Thread.run(Thread.java:844)
   Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-jlink of goal org.apache.maven.plugins:maven-jlink-plugin:3.0.0-alpha-1:jlink failed.
   	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
   	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
   	... 11 more
   Caused by: java.lang.NullPointerException
   	at org.codehaus.plexus.languages.java.jpms.ResolvePathsRequest$1.toPath(ResolvePathsRequest.java:52)
   	at org.codehaus.plexus.languages.java.jpms.ResolvePathsRequest$1.toPath(ResolvePathsRequest.java:48)
   	at org.codehaus.plexus.languages.java.jpms.LocationManager.resolvePaths(LocationManager.java:109)
   	at org.apache.maven.plugins.jlink.JLinkMojo.preparePaths(JLinkMojo.java:347)
   	at org.apache.maven.plugins.jlink.JLinkMojo.execute(JLinkMojo.java:264)
   	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
   	... 12 more
    > 
   > ``` 
   > 
   > The cause seems to be that the following code in line 337 in JLinkMojo returns a collection with only 'null' entries:
   > `Collection<File> dependencyArtifacts = getCompileClasspathElements( getProject() );`
   ```
   
   
   
   ---
   
   **Affects:** 3.0.0-alpha-1
   
   **Issue Links:**
   - [MJLINK-42](https://issues.apache.org/jira/browse/MJLINK-42) NullPointerException when running jlink:jlink
    (_**"is duplicated by"**_)
   
   **Remote Links:**
   - [GitHub Pull Request #133
   ](https://github.com/apache/maven-plugins/pull/133)
   
   3 votes, 8 watchers
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [MJLINK-4] NPE on execution [maven-jlink-plugin]

Posted by "jira-importer (via GitHub)" <gi...@apache.org>.
jira-importer commented on issue #248:
URL: https://github.com/apache/maven-jlink-plugin/issues/248#issuecomment-2629101242

   **[Bernd Eckenfels](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=b.eckenfels)** commented
   
   Just as an additional note, I had the same issue in alpha.1 and I noticed that using the POM parent `com.soebes.smpp:smpp:2.3.0` would work around it. I guess it updates some shared components or adds something to the model. Anyway.. waiting for alpha.2 :)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [MJLINK-4] NPE on execution [maven-jlink-plugin]

Posted by "jira-importer (via GitHub)" <gi...@apache.org>.
jira-importer commented on issue #248:
URL: https://github.com/apache/maven-jlink-plugin/issues/248#issuecomment-2629101238

   **[Jochen Mader](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=codepitbull)** commented
   
   Updated my deps to 3.0.0-alpha-2-SNAPSHOT and can confirm that the problem is gone.
   
   Thanks everyone for the fix!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [MJLINK-4] NPE on execution [maven-jlink-plugin]

Posted by "jira-importer (via GitHub)" <gi...@apache.org>.
jira-importer commented on issue #248:
URL: https://github.com/apache/maven-jlink-plugin/issues/248#issuecomment-2629101240

   **[Antonio Petrelli](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=apetrelli)** commented
   
   It works for me too, thank you!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [MJLINK-4] NPE on execution [maven-jlink-plugin]

Posted by "jira-importer (via GitHub)" <gi...@apache.org>.
jira-importer commented on issue #248:
URL: https://github.com/apache/maven-jlink-plugin/issues/248#issuecomment-2629101236

   **[Antonio Petrelli](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=apetrelli)** commented
   
   Hello
   as you may notice I submitted a pull request for the fix. It works for me. I gathered info from:
   https://vzurczak.wordpress.com/2016/01/08/finding-dependencies-artifacts-in-your-maven-plug-in/
   The upgrade to Maven 3.1.1 (I was cautious on this) was due to a problem like this:
   https://github.com/mrice/license-check/issues/8
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [MJLINK-4] NPE on execution [maven-jlink-plugin]

Posted by "jira-importer (via GitHub)" <gi...@apache.org>.
jira-importer commented on issue #248:
URL: https://github.com/apache/maven-jlink-plugin/issues/248#issuecomment-2629101237

   **[Robert Scholte](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=rfscholte)** commented
   
   Fixed in [r1812236](http://svn.apache.org/viewvc?rev=1812236&view=rev)
   
   Key issue was that only the poms were downloaded, without the main artifacts. I've added an integration test to confirm this.
   
   Thanks for the provided examples and the good intentions for the fix, which n the end was only a replacement of one word.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [MJLINK-4] NPE on execution [maven-jlink-plugin]

Posted by "jira-importer (via GitHub)" <gi...@apache.org>.
jira-importer commented on issue #248:
URL: https://github.com/apache/maven-jlink-plugin/issues/248#issuecomment-2629101228

   **[Johannes Boesl](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=j.boesl)** commented
   
   Try to build maven module 'jloadr-jre' at https://github.com/aditosoftware/jloadr/tree/merged
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [MJLINK-4] NPE on execution [maven-jlink-plugin]

Posted by "jira-importer (via GitHub)" <gi...@apache.org>.
jira-importer commented on issue #248:
URL: https://github.com/apache/maven-jlink-plugin/issues/248#issuecomment-2629101230

   **[Jochen Mader](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=codepitbull)** commented
   
   I ran into the same issue and created a somewhat smaller example to highlight the problem:
   
   https://github.com/codepitbull/java9playground
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [MJLINK-4] NPE on execution [maven-jlink-plugin]

Posted by "jira-importer (via GitHub)" <gi...@apache.org>.
jira-importer commented on issue #248:
URL: https://github.com/apache/maven-jlink-plugin/issues/248#issuecomment-2629101232

   **[Jochen Mader](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=codepitbull)** commented
   
   [Johannes Boesl](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=j.boesl) I am on Mac OS 10.11.6.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [MJLINK-4] NPE on execution [maven-jlink-plugin]

Posted by "jira-importer (via GitHub)" <gi...@apache.org>.
jira-importer commented on issue #248:
URL: https://github.com/apache/maven-jlink-plugin/issues/248#issuecomment-2629101245

   **[Karl Heinz Marbaise](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=khmarbaise)** commented
   
   Many thanks [Bernd Eckenfels](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=b.eckenfels) for the feedback.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [MJLINK-4] NPE on execution [maven-jlink-plugin]

Posted by "jira-importer (via GitHub)" <gi...@apache.org>.
jira-importer commented on issue #248:
URL: https://github.com/apache/maven-jlink-plugin/issues/248#issuecomment-2629101231

   **[Johannes Boesl](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=j.boesl)** commented
   
   [Jochen Mader](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=codepitbull) what os did you use? I'm using Ubuntu. Maybe it doesn't occur on windows.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [MJLINK-4] NPE on execution [maven-jlink-plugin]

Posted by "jira-importer (via GitHub)" <gi...@apache.org>.
jira-importer commented on issue #248:
URL: https://github.com/apache/maven-jlink-plugin/issues/248#issuecomment-2629101244

   **[Bernd Eckenfels](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=b.eckenfels)** commented
   
   I can confirm the NPE is gone with 
   
   https://repository.apache.org/content/repositories/snapshots/org/apache/maven/plugins/maven-jlink-plugin/3.0.0-alpha-2-SNAPSHOT/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [MJLINK-4] NPE on execution [maven-jlink-plugin]

Posted by "jira-importer (via GitHub)" <gi...@apache.org>.
jira-importer commented on issue #248:
URL: https://github.com/apache/maven-jlink-plugin/issues/248#issuecomment-2629101227

   **[Karl Heinz Marbaise](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=khmarbaise)** commented
   
   Can you please make an example project which reproduces the issue...Many thanks...
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org