我尝试用 maven 构建一个 java 项目。我使用 java 7,但 maven 源是 1.6。我无法改变它。当我运行“mvn clean install”时,它失败并出现一个奇怪的错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project search: Compilation failure
[ERROR] could not parse error message: warning: [options] bootstrap class path not set in conjunction with -source 1.6
[ERROR] /someClassName.java:114: warning: [deprecation] LUCENE_36 in Version has been deprecated
[ERROR] out = new ICUCollationKeyAnalyzer(Version.LUCENE_36, l);
[ERROR] ^
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project search: Compilation failure
could not parse error message: warning: [options] bootstrap class path not set in conjunction with -source 1.6
/someClassName.java:114: warning: [deprecation] LUCENE_36 in Version has been deprecated
out = new ICUCollationKeyAnalyzer(Version.LUCENE_36, l);
目前,我不会按照 maven 的建议更改 lucene 版本。所以,我想知道为什么 maven 关心代码中已弃用的东西以及如何避免这些错误?谢谢。
Apache Maven 3.0.4
Java version: 1.7.0_25, vendor: Oracle Corporation