springboot踩坑日记-java: User-specified option “-proc:none“ is ignored for “xxx-xxx-common“. This compil

项目在使用IntelliJ IDEA内置构建时遇到错误,表现为User-specified option '-proc:none'被忽略及ClassCastException。问题可能源于Maven配置与IDE设置不一致。虽然通过Maven命令行构建成功,但在IDE中构建失败。解决方案可能涉及调整IDEA的Maven配置,确保其与项目的编译参数匹配。
摘要由CSDN通过智能技术生成

环境:

  • java: 11.0.15.1
  • maven: 3.6.3
  • idea: 2021.1

核心错误信息:

java: User-specified option "-proc:none" is ignored for "xxx-xxx-common". This compilation parameter is set automatically according to project settings.
java: java.lang.ClassCastException: class com.sun.proxy.$Proxy27 cannot be cast to class com.sun.tools.javac.processing.JavacProcessingEnvironment (com.sun.proxy.$Proxy27 is in unnamed module of loader java.net.URLClassLoader @5ecddf8f; com.sun.tools.javac.processing.JavacProcessingEnvironment is in module jdk.compiler of loader 'app')
java: java.lang.ClassCastException: class com.sun.proxy.$Proxy27 cannot be cast to class com.sun.tools.javac.processing.JavacProcessingEnvironment (com.sun.proxy.$Proxy27 is in unnamed module of loader java.net.URLClassLoader @5ecddf8f; com.sun.tools.javac.processing.JavacProcessingEnvironment is in module jdk.compiler of loader 'app')

项目启动报错

Executing pre-compile tasks...
Loading Ant configuration...
Running Ant tasks...
Running 'before' tasks
Checking sources
Copying resources... [xxx-xxx-loyalty]
Copying resources... [xxx-xxx-core]
Copying resources... [xxx-xxx-common]
Copying resources... [xxx-xxx-api]
Copying resources... [xxx-xxx-adapter]
Parsing java... [xxx-xxx-common]
java: User-specified option "-proc:none" is ignored for "xxx-xxx-common". This compilation parameter is set automatically according to project settings.
java: java.lang.ClassCastException: class com.sun.proxy.$Proxy27 cannot be cast to class com.sun.tools.javac.processing.JavacProcessingEnvironment (com.sun.proxy.$Proxy27 is in unnamed module of loader java.net.URLClassLoader @5ecddf8f; com.sun.tools.javac.processing.JavacProcessingEnvironment is in module jdk.compiler of loader 'app')
java: java.lang.ClassCastException: class com.sun.proxy.$Proxy27 cannot be cast to class com.sun.tools.javac.processing.JavacProcessingEnvironment (com.sun.proxy.$Proxy27 is in unnamed module of loader java.net.URLClassLoader @5ecddf8f; com.sun.tools.javac.processing.JavacProcessingEnvironment is in module jdk.compiler of loader 'app')
Checking dependencies... [xxx-xxx-common]
Dependency analysis found 0 affected files
Errors occurred while compiling module 'accor-dfc-common'
javac 11.0.15.1 was used to compile java sources
Finished, saving caches...
Executing post-compile tasks...
Loading Ant configuration...
Running Ant tasks...
Synchronizing output directories...
2022/5/18, 9:18 上午 - Build completed with 2 errors and 0 warnings in 3 sec, 212 ms

排查:
使用maven命令构建成功,
在这里插入图片描述

使用idea内置构建失败

异常原因:
maven的问题,具体原因不太清楚

解决:
勾选
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

刘彦青-Yannis

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值