mojohaus / maven-native

https://www.mojohaus.org/maven-native/
MIT License
18 stars 12 forks source link

NPE at org.codehaus.mojo.natives.c.AbstractCCompiler.setIncludePaths (AbstractCCompiler.java:122) #30

Open zosrothko opened 5 years ago

zosrothko commented 5 years ago

Hello

Using msvc as and the configuration below where the element is empty (typo on ${baseDir} instead of ${basedir}

    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>native-maven-plugin</artifactId>
        <version>1.0-alpha-9</version>
        <extensions>true</extensions>
        <configuration>
            <compilerProvider>msvc</compilerProvider>
            <compilerExecutable>cl</compilerExecutable>
            <sources>
                <source>
                    <directory>${baseDir}</directory>
                    <fileNames>
                        <fileName>ezasoket.c</fileName>
                    </fileNames>
                </source>
            </sources>
        </configuration>
    </plugin>

one gets a NPE

[INFO] --- native-maven-plugin:1.0-alpha-9:compile (default-compile) @ EZASOCKET ---
[DEBUG] Configuring mojo org.codehaus.mojo:native-maven-plugin:1.0-alpha-9:compile from plugin realm ClassRealm[extension>org.codehaus.mojo:native-maven-plugin:1.0-alpha-9, parent: sun.misc.Launcher$AppClassLoader@5c647e05]
[DEBUG] Configuring mojo 'org.codehaus.mojo:native-maven-plugin:1.0-alpha-9:compile' with basic configurator -->
[DEBUG]   (f) compilerExecutable = cl
[DEBUG]   (f) compilerOutputDirectory = Z:\MXW\CO\1.2\CallOut\zOS\EZASOKET\target\objs
[DEBUG]   (f) compilerProvider = msvc
[DEBUG]   (f) dependencyIncludeDirectory = Z:\MXW\CO\1.2\CallOut\zOS\EZASOKET\target\native\include
[DEBUG]   (f) jdkIncludePath = C:\Program Files\Java\jdk1.8.0_181\jre\..\include
[DEBUG]   (f) numberOfConcurrentCompilation = 1
[DEBUG]   (f) project = MavenProject: com.scort.callout.scortzos:EZASOCKET:1.2.0-SNAPSHOT @ Z:\MXW\CO\1.2\CallOut\zOS\EZASOKET\pom.xml
[DEBUG]   (s) fileNames = [ezasoket.c]
[DEBUG]   (f) sources = [org.codehaus.mojo.natives.NativeSources@306f6f1d]
[DEBUG]   (f) workingDirectory = Z:\MXW\CO\1.2\CallOut\zOS\EZASOKET
[DEBUG] -- end configuration --
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.930 s
[INFO] Finished at: 2019-03-15T09:38:53+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:native-maven-plugin:1.0-alpha-9:compile (default-compile) on project EZASOCKET: Execution default-compile of goal org.codehaus.mojo:native-maven-plugin:1.0-alpha-9:compile failed.: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:native-maven-plugin:1.0-alpha-9:compile (default-compile) on project EZASOCKET: Execution default-compile of goal org.codehaus.mojo:native-maven-plugin:1.0-alpha-9:compile 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.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    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: org.apache.maven.plugin.PluginExecutionException: Execution default-compile of goal org.codehaus.mojo:native-maven-plugin:1.0-alpha-9:compile failed.
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
    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:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    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.NullPointerException
    at org.codehaus.mojo.natives.c.AbstractCCompiler.setIncludePaths (AbstractCCompiler.java:122)
    at org.codehaus.mojo.natives.c.AbstractCCompiler.getCommandLine (AbstractCCompiler.java:75)
    at org.codehaus.mojo.natives.msvc.MSVCCompiler.getCommandLine (MSVCCompiler.java:72)
    at org.codehaus.mojo.natives.compiler.AbstractCompiler.compile (AbstractCompiler.java:89)
    at org.codehaus.mojo.natives.plugin.NativeCompileMojo.execute (NativeCompileMojo.java:159)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    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:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    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)
[ERROR]
[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

Z:\MXW\CO\1.2\CallOut\zOS\EZASOKET>