Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/337.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java maven编译器插件:3.1:编译失败。空指针异常_Java_Maven_Maven Compiler Plugin - Fatal编程技术网

Java maven编译器插件:3.1:编译失败。空指针异常

Java maven编译器插件:3.1:编译失败。空指针异常,java,maven,maven-compiler-plugin,Java,Maven,Maven Compiler Plugin,我在maven编译器插件3.1中得到了NullPointerException。我在SOF上调查过类似的问题,但都是徒劳的尝试 我运行的命令:mvn compile maven环境: Apache Maven 3.0.3 (rNON-CANONICAL_2011-12-28_13-22_mein; 2011-12-28 13:22:36-0600) Maven home: /soft/maven/3.0.3 Java version: 1.6.0_38, vendor: Sun Microsys

我在maven编译器插件3.1中得到了NullPointerException。我在SOF上调查过类似的问题,但都是徒劳的尝试

我运行的命令
mvn compile

maven环境

Apache Maven 3.0.3 (rNON-CANONICAL_2011-12-28_13-22_mein; 2011-12-28 13:22:36-0600)
Maven home: /soft/maven/3.0.3
Java version: 1.6.0_38, vendor: Sun Microsystems Inc.
Java home: /soft/jdk1.6.0_38-arch/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-83-generic", arch: "amd64", family: "unix"
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project wikibrain-utils: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile failed. NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project wikibrain-utils: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile failed.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
    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:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile failed.
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more
Caused by: java.lang.NullPointerException
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.hasNewFile(AbstractCompilerMojo.java:1198)
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.isDependencyChanged(AbstractCompilerMojo.java:1166)
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:648)
    at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    ... 20 more
[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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :wikibrain-utils
(它使用1.6,因为这是项目(遗留项目)所要求的)

错误消息

Apache Maven 3.0.3 (rNON-CANONICAL_2011-12-28_13-22_mein; 2011-12-28 13:22:36-0600)
Maven home: /soft/maven/3.0.3
Java version: 1.6.0_38, vendor: Sun Microsystems Inc.
Java home: /soft/jdk1.6.0_38-arch/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-83-generic", arch: "amd64", family: "unix"
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project wikibrain-utils: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile failed. NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project wikibrain-utils: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile failed.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
    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:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile failed.
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more
Caused by: java.lang.NullPointerException
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.hasNewFile(AbstractCompilerMojo.java:1198)
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.isDependencyChanged(AbstractCompilerMojo.java:1166)
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:648)
    at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    ... 20 more
[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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :wikibrain-utils
[ERROR]未能在wikibrain项目上执行goal org.apache.maven.plugins:maven编译器插件:3.1:compile(默认编译):执行goal org.apache.maven的默认编译。plugins:maven编译器插件:3.1:compile失败。NullPointerException->[帮助1]
org.apache.maven.lifecycle.LifecycleExecutionException:未能执行目标org.apache.maven.plugins:maven编译器插件:3.1:wikibrain项目上的编译(默认编译):执行目标org.apache.maven的默认编译。plugins:maven编译器插件:3.1:compile失败。
位于org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
位于org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
位于org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
位于org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
位于org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
位于org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
位于org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
在org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)上
位于org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
位于org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
位于org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处
位于sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)中
位于java.lang.reflect.Method.invoke(Method.java:597)
位于org.codehaus.plexus.classworlds.launcher.launcher.launchEnhanced(launcher.java:290)
位于org.codehaus.plexus.classworlds.launcher.launcher.launch(launcher.java:230)
位于org.codehaus.plexus.classworlds.launcher.launcher.mainWithExitCode(launcher.java:409)
位于org.codehaus.plexus.classworlds.launcher.launcher.main(launcher.java:352)
原因:org.apache.maven.plugin.PluginExecutionException:目标org.apache.maven.plugins的执行默认编译:maven编译器插件:3.1:编译失败。
位于org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
位于org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 还有19个
原因:java.lang.NullPointerException
位于org.apache.maven.plugin.compiler.AbstractCompilerMojo.hasNewFile(AbstractCompilerMojo.java:1198)
位于org.apache.maven.plugin.compiler.AbstractCompilerMojo.isDependencyChanged(AbstractCompilerMojo.java:1166)
位于org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:648)
位于org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
位于org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
... 20多
[错误]
[错误]
[错误]有关错误和可能的解决方案的更多信息,请阅读以下文章:
[错误][帮助1]http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[错误]
[错误]纠正问题后,可以使用命令恢复生成
[错误]mvn-rf:wikibrain utils

我已经解决了这个问题-它碰巧是一个文件权限问题


Allen在Windows上编译到SMB共享(在NAS上)时遇到同样的问题

从3.7.0更新到3.8.0修复了它。

        <artifactId>maven-compiler-plugin</artifactId>
        <groupId>org.apache.maven.plugins</groupId>
        <version>3.8.0</version>
maven编译器插件
org.apache.maven.plugins
3.8.0
这是我得到的堆栈轨迹的一部分,以防它帮助其他人发现相同的问题

原因:java.lang.NullPointerException
在org.apache.maven.plugin.compiler.AbstractCompilerMojo.hasNewFile(AbstractCompilerMojo.java:1574)

3.1已经很旧了。使用最新的3.5.1,并尝试发布问题的详细信息。不要使用Maven 3.0.3,它确实有问题。使用更为更新的版本,如3.3.9…哪个文件需要权限/