Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile

使用maven的时候,编译的时候很容易造成以下的错误,导致编译不过去,其实解决方案并不难。

 

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project XXXXXX: Compilation failure
[ERROR] /F:/interface/common-web/src/main/java/com/hlpay/external/commont/controller/QueryUserController.java:[72,70] 找不到符号
[ERROR] 符号:   方法 queryNewUser(com.hlpay.external.common.view.CommonModel)
[ERROR] 位置: 类型为com.hlpay.external.common.api.IQueryUser的变量 iQueryUser
[ERROR] -> [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

 

 

解决方案:

  选择工程-->build path-->configure Build path-->Libraries 选择jre System library ,进行编辑,弹出jre system library窗口,选择第二个单选按钮Alternate jre 点击旁边的Installed jres按钮,选择自己jdk的安装路径,点击“确定”,设置成自己安装的jdk。再次编译,问题解决。

 若是测试编译不过去,将target下的异常日志中所记录的测试类删除即可。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值