解決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
- Failed to execute aapt的奇怪解決方法AIAPT
- NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load xxxx錯誤解決方法ErrorAIXMLHTTP
- Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (default-cli)AIGoMavenPlugin
- ] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin Cannot instantiate object of typeAIGoMyBatisMavenPluginObject
- app:processReleaseResources, Failed to execute aaptAPPAIAPT
- Conversion to Dalvik format failed: Unable to execute dexORMAI
- Vue 啟動專案報錯 Failed to compile with 2 errorsVueAICompileError
- 解決:Failed to load ApplicationContextAIAPPContext
- 解決:Failed to download metadata for repo ‘base‘AI
- Failed to execute user defined function(anonfun$concatStr$1: (map<string,string>, string) => string)AIFunction
- 關於Failed to resolve的問題解決AI
- 解決 yum clean all Error rpmdb open failedErrorAI
- Maven 教程(21)— maven-compiler-plugin 外掛詳解MavenCompilePlugin
- maven-compiler-plugin外掛引數配置詳解MavenCompilePlugin
- My New GoalGo
- 解決 Android studio Connect to 127.0.0.1:[/127.0.0.1] failed: Connection refusedAndroid127.0.0.1AI
- flutter packages get - pub get failed (1)解決方案FlutterPackageAI
- INSTALL_FAILED_NO_MATCHING_ABIS終極解決方案AI
- 解決elasticsearch:Exception BindTransportException[Failed to bind to [9300-9400]]ElasticsearchExceptionAI
- goal 元件一覽Go元件
- Oracle Net Configuration Assistant failed異常的解決方案OracleAI
- idea系列:解決啟動 failed to load JVM DLL 提示IdeaAIJVM
- IDEA提示failed to load JVM DLL的解決辦法IdeaAIJVM
- 解決nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)NginxAI
- mongodb錯誤解決辦法-bash: ./mongod: cannot execute binary file: Exec format errorMongoDBORMError
- 解決Maven外掛無法下載Cannot resolve plugin org.apache.maven.plugins:maven-clean-plugin:2.5MavenPluginApache
- Plugin 'org.apache.maven.plugins:maven-resources-plugin:2.7' not found less... (Ctrl+F1)問題解決PluginApacheMaven
- 【Bug解決】CentOS-8中“Failed to download metadata for repo ‘AppStreamCentOSAIAPP
- RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED解決辦法ErrorDNNAI
- vscode中Git: host key verification failed的解決辦法VSCodeGitAI
- Unable to save settings: Failed to save settings. Please restart PyCharm解決AIRESTPyCharm
- 解決Spring Boot測試方法Failed to load ApplicationContext問題Spring BootAIAPPContext
- remount of /system failed: Read-only file system原因及解決REMAI
- 解決 sail composer update 時出現的 Update of laravel/sail failedAILaravel
- Ubuntu18.04..5 配置國內映象源:解決E: Failed to fetchUbuntuAI
- Mac OSX系統homebrew update Fetching failed問題解決方案MacAI
- Cargo invocation has failed: Error: exit code: 101.解決辦法CargoAIError