解決Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile(default-compile)
報錯:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project test01-hello-mybatis: Fatal error compiling: 錯誤: 無效的目標發行版:12.0.2 -> [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 problem in their configuration or the information they retrieved from the POM.
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 核心本身生成的,而是由外掛生成的。作為一個經驗法則,外掛使用這個錯誤訊號的配置問題或資訊,他們從 pom 檢索。異常的具體含義取決於外掛,所以請檢視它的文件。許多常見的 maven 外掛的文件可以通過我們的外掛索引訪問。
解決方案
指定編譯的JDK版本,在專案依賴中修改以下資訊:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>12.0.2</maven.compiler.source>
<maven.compiler.target>12.0.2</maven.compiler.target>
</properties>
將其JDK版本改為
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>12</maven.compiler.source>
<maven.compiler.target>12</maven.compiler.target>
</properties>
其它版本的jdk解決方案類似。
如果該解決方案無法解決可參考其他部落格,
對
file–>settings–> Build, Execution, Deployment–>Build Tools–>Maven–>runner
或者Build, Execution, Deployment–>compile–>Java Compile裡面的jdk版本修改為自己本地的jdk版本試試。
相關文章
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compileAIGoApacheMavenPluginCompile
- [ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.5.0-rc1:compile (default) on project zeus-web: Command 解決ErrorAIGoMavenPluginCompileProjectWeb
- Failed to execute aapt的奇怪解決方法AIAPT
- ] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin Cannot instantiate object of typeAIGoMyBatisMavenPluginObject
- app:processReleaseResources, Failed to execute aaptAPPAIAPT
- NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load xxxx錯誤解決方法ErrorAIXMLHTTP
- Conversion to Dalvik format failed: Unable to execute dexORMAI
- Vue 啟動專案報錯 Failed to compile with 2 errorsVueAICompileError
- pyenv BUILD FAILED解決方法UIAI
- Unable to execute dex: Multiple dex files define 解決方法
- 解決:Failed to load ApplicationContextAIAPPContext
- Dex Loader] Unable to execute dex: Multiple dex files define 解決
- My New GoalGo
- Maven 教程(21)— maven-compiler-plugin 外掛詳解MavenCompilePlugin
- maven-compiler-plugin外掛引數配置詳解MavenCompilePlugin
- 解決:Failed to download metadata for repo ‘base‘AI
- 解決Xmanager-AIX XDMCP Connection failedAI
- android錯誤unable to execute dex java heap space解決方案AndroidJava
- goal 元件一覽Go元件
- SMART Goal SettingGo
- 解決 yum clean all Error rpmdb open failedErrorAI
- flutter packages get - pub get failed (1)解決方案FlutterPackageAI
- 解決ssh的"Write failed: Broken pipe"問題AI
- [IOS]解決Failed to start Instruments daemon for ‘iOS’ on iPhoneiOSAIiPhone
- Failed to install *.apk on device null解決辦法AIAPKdevNull
- Redhat 下 ASM oracleasm deletedisk -failed 的解決方法RedhatASMOracledeleteAI
- 關於Failed to resolve的問題解決AI
- MongoDB報錯"not authorized on root to execute command"問題解決一例MongoDBZed
- 【Android-tips】 Unable to execute dex: Multiple dex files define 解決方法Android
- 10.24-28 GOALGo
- INSTALL_FAILED_NO_MATCHING_ABIS錯誤解決AI
- Apache無法啟動解決 the requested operation has failedApacheAI
- Ping:Transmit Failed, Error Code 65問題解決MITAIError
- ORA-09817: Write to audit file failed 的解決AI
- socket write failed(24) _Netbackup的問題解決AI
- Plugin 'org.apache.maven.plugins:maven-resources-plugin:2.7' not found less... (Ctrl+F1)問題解決PluginApacheMaven
- INSTALL_FAILED_NO_MATCHING_ABIS終極解決方案AI
- 解決elasticsearch:Exception BindTransportException[Failed to bind to [9300-9400]]ElasticsearchExceptionAI