无法执行目标org.apache.maven.plugins:maven-enforcer-plugin [英] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin

查看:1171
本文介绍了无法执行目标org.apache.maven.plugins:maven-enforcer-plugin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个maven spring项目,但是当我尝试运行它时,我却无法...对此有所了解...
接下来是错误消息:

I got a maven spring project but when I try to run it, I can't... some idea about it...
The next is the Error Message:

BUILD FAILURE
------------------------------------------------------------------------
Total time: 4.532s
Finished at: Wed Jul 26 16:04:06 COT 2017
Final Memory: 17M/196M
------------------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce
(enforce-versions) on project SIMI: Some Enforcer rules have failed. Look above for
specific messages explaining why the rule failed. -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.

使用-X开关重新运行Maven以启用完整的调试日志记录.

Re-run Maven using the -X switch to enable full debug logging.

有关错误和可能的解决方案的更多信息,请阅读以下文章: [帮助1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

For more information about the errors and possible solutions, please read the following articles: [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

推荐答案

可能导致此问题的一件事是,在您的项目中的POM文件中设置了必需的Java或maven版本.您应该找到它...但是怎么找到呢? 也许您找不到像我这样的项目中的任何执行者... (我遇到了同样的问题,因为在我的项目POM中未定义执行程序插件,所以我感到困惑.)

one thing that may cause this problem is that in your project in a POM file required java or maven version is set. you should find it... but how ? maybe you couldn't find any enforcer in your project like me ... (I had the same problem and I became confused because enforcer plugin was not defined in my projects POMs, so I couldn't find it).

enforcer插件在您的有效pom" 中,您应该进行检查. 有效pom 是由超级pom +项目pom制成的配置文件. maven使用此配置文件执行相关目标.它可以帮助开发人员在其pom.xml中指定最低配置详细信息.尽管可以轻松地覆盖配置.

enforcer plugin is in your "effective pom" and you should check it. Effective pom is a configuration file made from super pom + project pom. maven use this configuration file to execute the relevant goal. It helps developers to specify minimum configuration detail in his/her pom.xml. Although configurations can be overridden easily.

要显示有效的pom,有两种方法: 1-使用maven命令,运行此命令:

For showing your effective pom there are 2 ways: 1- use maven command, run this command :

 mvn help:effective-pom

2-使用您的IDE:在Maven窗口中,右键单击您的项目节点,然后选择显示有效的POM(取决于您的IDE).

2- use your IDE : in Maven window right click on your project node and select show effective POM(it depends on your IDE).

找到自己的力量之后,您可以在项目中找到它并进行更改. 对我而言,我的有效POM 包含了强制执行器插件,其使用Java的requireMavenVersion规则为1.8.因此我将项目的JDK版本更改为1.8,幸运的是问题得以解决.

after you find what your forces are you can find it in your project and change it. for me, My effective POM had enforcer plugin which its requireMavenVersion rule for using Java was 1.8. so I changed my project JDK version to 1.8 and luckily the problem was solved.

我希望这个答案可以对您有所帮助.

I hope this answer could help you.

这篇关于无法执行目标org.apache.maven.plugins:maven-enforcer-plugin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆