錯誤現象:
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project cjj: Compilation failure -> [Help 1]
官方幫助文檔:
Unlike many other errors, this exception is not generated by the Maven core itself but by a plugin. As a rule of thumb, plugins use this error to signal a failure of the build because there is something wrong with the dependencies or sources of a project, e.g. a compilation or a test failure.
The concrete meaning of the exception depends on the plugin so please have a look at its documentation. The documentation for many common Maven plugins can be reached via our plugin index.
翻譯:
與許多其他錯誤不同,此異常不是由Maven核心本身生成的,而是由插件生成的。 根據經驗,插件使用此錯誤來表示構建失敗,因為項目的依賴項或源代碼存在問題,例如: 編譯或測試失敗。
異常的具體含義取決於插件,所以請查看其文檔。 可以通過我們的插件索引訪問許多常見Maven插件的文檔。
解決:
在我遇到的情況下,是這樣解決的,更換jdk的版本號即可。
如果不行,加上下買呢內容:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.6.1</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin>