maven编译开源项目报enforce错解决
刚下载一个开源项目源码,用maven编译发现报错:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.:enforce (enforce-versions) on project spark-parent_2.: Some Enforcer rules
have failed. Look above for specific messages explaining why the rule failed. -> [Help ]
[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 ] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
根据报错提示信息得出是enforce插件检测规则失败,并且这里提供了一个官方解决连接,进入看看MojoExecutionException解释:

说明这个不是maven本身报错,而是它的插件报错了,并且告诉我们要去看一下插件的文档,提供了maven插件文档的链接,进入plugin index找到enforce插件,先看看这个插件是干什么的:


这里的对enforcer的解释是,这是做环境约束检查用,到pom.xml中找到对应的enforce插件:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.4.</version>
<executions>
<execution>
<id>enforce-versions</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>${maven.version}</version>
</requireMavenVersion>
<requireJavaVersion>
<version>${java.version}</version>
</requireJavaVersion>
<bannedDependencies>
<excludes>
<!--
Akka depends on io.netty:netty, which puts classes under the org.jboss.netty
package. This conflicts with the classes in org.jboss.netty:netty
artifact, so we have to ban that artifact here. In Netty .x, the classes
are under the io.netty package, so it's fine for us to depend on both
io.netty:netty and io.netty:netty-all.
-->
<exclude>org.jboss.netty</exclude>
<exclude>org.codehaus.groovy</exclude>
</excludes>
<searchTransitive>true</searchTransitive>
</bannedDependencies>
</rules>
</configuration>
</execution>
</executions>
</plugin>
这里对java.version和maven.version做了约束,把配置改成本地对应的版本号即可。
参考:
https://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
http://maven.apache.org/plugins/
maven编译开源项目报enforce错解决的更多相关文章
- 使用maven编译Java项目 http://www.tuicool.com/articles/YfIfIrq
使用maven编译Java项目 时间 2014-07-17 17:42:37 Way Lau's Blog 原文 http://www.waylau.com/build-java-project- ...
- 使用maven编译Java项目
摘要: 综述 本文演示了用Maven编译Java项目 需要 时间:15分钟 文本编辑器或者IDE JDK 6 或者更高版本 创建项目 本例主要为了展示Maven,所以Java的项目力求简单. 创建项目 ...
- asp.net MVC webservice 报次错解决方法
asp.net MVC webservice 报次错解决方法: 解决方法: 在 RouteConfig.cs public static void RegisterRoutes(RouteCol ...
- 解决maven编译spark1.5报错问题
spark1.5发布了,赶紧去下了源码尝鲜 git clone git://github.com/apache/spark.git -b branch-1.5 输入命令进行编译 ./make-dist ...
- 利用Eclipse中的Maven构建Web项目报错(一)
利用Eclipse中的Maven构建Web项目 1.在进行上述操作时,pom.xml一直报错 <project xmlns="http://maven.apache.org/POM/4 ...
- Eclipse/IDEA中使用Maven创建Web项目报错
Eclipse中的错误:Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp-1.0.jar:R ...
- 利用Eclipse中的Maven构建Web项目报错(二)
利用Eclipse中的Maven构建Web项目 1.错误描述 [INFO] Scanning for projects... [INFO] [INFO] Using the builder org.a ...
- maven部署tomcat项目,403错误解决
maven部署tomcat项目时403错误的解决方法 web模块的pom文件 pom.xml <plugin> <groupId>org.apache.tomcat.maven ...
- 【待解决】maven创建web项目报错
创建web项目时报错
随机推荐
- 关于'selffilter' is not a registered tag library. Must be one of:
报错代码: 'selffilter' is not a registered tag library. Must be one of: admin_list admin_modify admin_st ...
- 关于OSError: [WinError 10038] 在一个非套接字上尝试了一个操作。
在使用socket的时候,写了一个while循环,就报错了.结果如下: OSError: [WinError 10038] 在一个非套接字上尝试了一个操作. 代码 import socket impo ...
- 【Git之旅】1.Git常用命令
1.创建初始化版本库 git init 2.将文件添加到版本库中 git add index.html (添加到暂存区) git add . 命令让Git把当前目录及目录中的文件都添加到版本库里 gi ...
- linux日常服务器部署一些命令使用
今天公司的开发环境的linux服务器,我要了一个账号来玩玩 拿到账号和密码,我就用xshell登陆上去 1.查看已挂载的分区列表 df -h 显示已经挂载的分区列表 2.查看目录中的文件 ls 查看目 ...
- 没错,老板让我写个 BUG!
前言 标题没有看错,真的是让我写个 bug! 刚接到这个需求时我内心没有丝毫波澜,甚至还有点激动.这可是我特长啊:终于可以光明正大的写 bug 了
- 【Python3爬虫】自动查询天气并实现语音播报
一.写在前面 之前写过一篇用Python发送天气预报邮件的博客,但是因为要手动输入城市名称,还要打开邮箱才能知道天气情况,这也太麻烦了.于是乎,有了这一篇博客,这次我要做的就是用Python获取本机I ...
- JAVA WEB快速入门之从编写一个基于SpringBoot+Mybatis快速创建的REST API项目了解SpringBoot、SpringMVC REST API、Mybatis等相关知识
JAVA WEB快速入门系列之前的相关文章如下:(文章全部本人[梦在旅途原创],文中内容可能部份图片.代码参照网上资源) 第一篇:JAVA WEB快速入门之环境搭建 第二篇:JAVA WEB快速入门之 ...
- Innosetup 设置文件的相对路径
在使用innosetup自动化打包的过程中,如果打包配置文件要随代码一起提交,则需要将打包文件改为相对路径,以便在其它端也可以直接打包,而不需要再次修改文件路径参数. 添加自动化打包文件 1. 添加b ...
- IT研发工程师职业规划
一些年过去了,以下关于IT研发工程师纬度的职业规划PPT,仍然有一些可以借鉴: ------------------------------------------------------------ ...
- Java 合并、拆分PDF文档
处理PDF文档时,我们可以通过合并的方式,来任意组几个不同的PDF文件或者通过拆分将一个文件分解成多个子文件,这样的好处是对文档的存储.管理很方便.下面将通过Java程序代码介绍具体的PDF合并.拆分 ...