[m-jlink-p] NPE for small project

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[m-jlink-p] NPE for small project

Bernd Eckenfels
Hello,

when I use a simple POM like this:

<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>
       
        <parent>
                <groupId>com.soebes.smpp</groupId>
                <artifactId>smpp</artifactId>
                <version>2.3.0</version>
        </parent>
       
        <groupId>net.eckenfels.etotp</groupId>
        <artifactId>et-otp-image</artifactId>
        <version>1.3-SNAPSHOT</version>
        <packaging>jlink</packaging>

        <properties>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        </properties>

        <build>
                <plugins>
                        <plugin>
                                <artifactId>maven-jlink-plugin</artifactId>
                                <version>3.0.0-alpha-1</version>
                                <extensions>true</extensions>
                                <configuration>
                                        <verbose>true</verbose>
                                </configuration>
                        </plugin>
                </plugins>
        </build>

        <dependencies>
                <dependency>
                        <groupId>net.eckenfels.etotp</groupId>
                        <artifactId>et-otp</artifactId>
                        <version>1.3-SNAPSHOT</version>
                </dependency>
        </dependencies>

</project>


The jlink plugin will crash with a NPE unless I add the soebbes parent.

Not sure whats different (it does not seem to Change any shared component versions).

Here is the NPE:

3153 [WARN] The POM for net.eckenfels.etotp:et-otp:jar:1.3-SNAPSHOT is missing, no dependency information available
3153 [INFO]
3153 [INFO] --- maven-jlink-plugin:3.0.0-alpha-1:jlink (default-jlink) @ et-otp-image ---
3591 [INFO] Toolchain in maven-jlink-plugin: jlink [ C:\Program Files\Java\jdk-9.0.4\bin\jlink.exe ]
3591 [INFO] ------------------------------------------------------------------------
3591 [INFO] BUILD FAILURE
3591 [INFO] ------------------------------------------------------------------------
3591 [INFO] Total time: 1.741 s
3591 [INFO] Finished at: 2018-03-09T01:34:58+01:00
3691 [INFO] Final Memory: 8M/28M
3691 [INFO] ------------------------------------------------------------------------
3691 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-jlink-plugin:3.0.0-alpha-1:jlink (default-jlink) on project et-otp-image: 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 et-otp-image: 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:224)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        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: 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:143)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 19 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:132)
        ... 20 more

I can open a bug Report if you think it is worth it - havent tried Alpha2-snapshot/master yet.

Gruss
Bernd
--
http://bernd.eckenfels.net

Reply | Threaded
Open this post in threaded view
|

Re: [m-jlink-p] NPE for small project

Bernd Eckenfels
Hello,

just found that this is a known and fixed issue: https://issues.apache.org/jira/browse/MJLINK-4

Gruss
Bernd
--
http://bernd.eckenfels.net

Von: Bernd Eckenfels
Gesendet: Freitag, 9. März 2018 01:37
An: Maven Developers List
Betreff: [m-jlink-p] NPE for small project

Hello,

when I use a simple POM like this:

<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>
               
                <parent>
                               <groupId>com.soebes.smpp</groupId>
                               <artifactId>smpp</artifactId>
                               <version>2.3.0</version>
                </parent>
               
                <groupId>net.eckenfels.etotp</groupId>
                <artifactId>et-otp-image</artifactId>
                <version>1.3-SNAPSHOT</version>
                <packaging>jlink</packaging>

                <properties>
                               <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                </properties>

                <build>
                               <plugins>
                                               <plugin>
                                                               <artifactId>maven-jlink-plugin</artifactId>
                                                               <version>3.0.0-alpha-1</version>
                                                               <extensions>true</extensions>
                                                               <configuration>
                                                                               <verbose>true</verbose>
                                                               </configuration>
                                               </plugin>
                               </plugins>
                </build>

                <dependencies>
                               <dependency>
                                               <groupId>net.eckenfels.etotp</groupId>
                                               <artifactId>et-otp</artifactId>
                                               <version>1.3-SNAPSHOT</version>
                               </dependency>
                </dependencies>

</project>


The jlink plugin will crash with a NPE unless I add the soebbes parent.

Not sure whats different (it does not seem to Change any shared component versions).

Here is the NPE:

3153 [WARN] The POM for net.eckenfels.etotp:et-otp:jar:1.3-SNAPSHOT is missing, no dependency information available
3153 [INFO]
3153 [INFO] --- maven-jlink-plugin:3.0.0-alpha-1:jlink (default-jlink) @ et-otp-image ---
3591 [INFO] Toolchain in maven-jlink-plugin: jlink [ C:\Program Files\Java\jdk-9.0.4\bin\jlink.exe ]
3591 [INFO] ------------------------------------------------------------------------
3591 [INFO] BUILD FAILURE
3591 [INFO] ------------------------------------------------------------------------
3591 [INFO] Total time: 1.741 s
3591 [INFO] Finished at: 2018-03-09T01:34:58+01:00
3691 [INFO] Final Memory: 8M/28M
3691 [INFO] ------------------------------------------------------------------------
3691 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-jlink-plugin:3.0.0-alpha-1:jlink (default-jlink) on project et-otp-image: 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 et-otp-image: 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:224)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        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: 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:143)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 19 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:132)
        ... 20 more

I can open a bug Report if you think it is worth it - havent tried Alpha2-snapshot/master yet.

Gruss
Bernd
--
http://bernd.eckenfels.net