maven-compiler-plugin:3.1: 编译失败.空指针异常 [英] maven-compiler-plugin:3.1:compile failed. NullPointerException

查看:183
本文介绍了maven-compiler-plugin:3.1: 编译失败.空指针异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 maven-compiler-plugin:3.1 中得到了 NullPointerException.我在 SOF 上调查了类似的问题,但没有成功.

I got NullPointerException with the maven-compiler-plugin:3.1. I have surveyed similar questions on SOF but in vain attempt.

我运行的命令:mvn compile

ma​​ven 环境:

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"

(它使用 1.6,因为这是一个遗留项目的项目需要)

(It's using 1.6 since this is required by the project, a legacy project)

错误信息:

[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

推荐答案

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

Had the same problem compiling on Windows to a SMB share (on a NAS..)

从 3.7.0 更新到 3.8.0 修复了它.

        <artifactId>maven-compiler-plugin</artifactId>
        <groupId>org.apache.maven.plugins</groupId>
        <version>3.8.0</version>

这是我得到的堆栈跟踪的一部分,以防它帮助其他人找到相同的问题.

Here is a piece of the stack track I was getting, in case it helps others find the same problem.

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

Caused by: java.lang.NullPointerException at org.apache.maven.plugin.compiler.AbstractCompilerMojo.hasNewFile (AbstractCompilerMojo.java:1574)

这篇关于maven-compiler-plugin:3.1: 编译失败.空指针异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆