SpringBoot使用maven打包命令失败

- 问题

在Termianl 输入
mvn clean package -Dmaven.test.skip=true

然后出现以下错误

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project nj_htgl: Compilation failure -> [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

- 解决方案

在pom.xml文件中添加

<plugin>
  <artifactId>maven-compiler-plugin</artifactId>
  <configuration>
  <source>1.8</source>
  <target>1.8</target>
  <fork>true</fork>
  <!--本地磁盘jdk路径 -->
  <executable>C:\Program Files\Java\jdk1.8.0_241\bin\javac</executable>
  </configuration>
</plugin>
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容