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

来源:互联网 发布:知乎用户 月薪 编辑:程序博客网 时间:2024/04/30 00:56

使用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下的异常日志中所记录的测试类删除即可。

0 0
原创粉丝点击