Maven Tycho编译失败

Con*_* DO 3 java eclipse-plugin eclipse-rcp tycho maven

我正在使用maven和tycho插件来构建一个eclipse RCP应用程序.我使用了一些像lambda表达式这样的java 8特性,但由于编译失败,它无法正确构建.

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.0.0:compile (default-compile) on project ***.***: Compilation failure: Compilation failure:      
[ERROR]     .filter(Objects::nonNull)
[ERROR]             ^^^^^^^^^^^^^^^^
[ERROR] Method references are allowed only at source level 1.8 or above
[ERROR] 2 problems (2 errors)
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[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/MojoFailureException
Run Code Online (Sandbox Code Playgroud)

我的问题是:

  • 你认为文件.settings/org.eclipse.jdt.core.prefs.classpath(我猜不是这个)是构建maven tycho所必需的吗?我是否必须在这些文件中明确定义java 8?
  • 我是否必须在pom文件中指定其他内容?

Con*_* DO 5

tycho-compiler-plugin文档中所述,文件.settings/org.eclipse.jdt.core.prefs中的信息将传递给编译器.

然后有必要更新文件如下:

org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.source=1.8
Run Code Online (Sandbox Code Playgroud)