在maven项目中使用add-source时,pom.xml报如下错误:

Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:build-helper-maven-plugin:1.8:add-source (execution: add-source, phase: generate-sources)

加入的代码如下:

            <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${basedir}/src/main/entity</source>
<source>${basedir}/src/main/modules</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>

原因是eclipse的m2e插件还没支持到execution,解决办法如下

在pom.xml文件中,<plugins></plugins>后加入如下代码:

<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
build-helper-maven-plugin
</artifactId>
<versionRange>
[1.8,)
</versionRange>
<goals>
<goal>add-source</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>

然后maven -> Update Project 即可

修复 Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:build-helper-maven-plugin:1.8:add-source (execution: add-source, phase: generate-sources)的更多相关文章

  1. maven项目-修复Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:build-helper-maven-plugin:1.8:add-resource (execution: add-resource, phase: generate-resources) pom.xml报错

    1:pom.xml代码 <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build- ...

  2. Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:build-helper-maven-plugin:1.8:add-test-source (execution: add-functional-source, phase: generate-sources)

    在maven项目中使用add-source时,pom.xml报如下错误: Plugin execution not covered by lifecycle configuration: org.co ...

  3. Maven项目POM文件错误,提示“Plugin execution not covered by lifecycle configuration”的解决方案

    一. 问题 Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-depend ...

  4. 解决Maven报Plugin execution not covered by lifecycle configuration

    来自:http://blog.csdn.net/xxd851116/article/details/25197373 环境     eclipse 4.3.0     maven 3.0.4     ...

  5. Plugin execution not covered by lifecycle configuration: aspectj-maven-plugin:1.8

    现象: eclipse导入existing maven project,(父项目包含很多子项目),子项目的pom.xml报错: Plugin execution not covered by life ...

  6. pom.xml报Plugin execution not covered by lifecycle configuration错误

    环境     eclipse 4.3.0     maven 3.0.4     m2e 1.4.0      出现场景     以前的老项目,在我的环境(我的环境较新)下,别人老环境不报错. 错误示 ...

  7. Plugin execution not covered by lifecycle configuration的解决方案

    pom配置文件中,提示错误:Plugin execution not covered by lifecycle configuration. 如图: 这表示m2e在其执行maven的生命周期管理时没有 ...

  8. 备忘:maven 错误信息: Plugin execution not covered by lifecycle configuration

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...

  9. 【技巧】“Plugin execution not covered by lifecycle configuration...“异常的处理

    问题现象: 在Eclipse(JEE mars)中新建maven project,选择archetype为:maven-archetype-plugin,结果生成的project存在错误:“Plugi ...

随机推荐

  1. CodeForces 483B 二分答案

    题目: B. Friends and Presents time limit per test 1 second memory limit per test 256 megabytes input s ...

  2. 周总结<2>

    本打算在这周日写周总结的,但由于事情太多,还要组织团日活动,所以没时间写.不过上周主要是一些书本上的学习,但是在周日的时候完成了一款小游戏还是比较有成就感的,但是主要是因为html的考试才去做的. 代 ...

  3. 学习c++ofstream和ifstream

    定义数据流对象指针 对文件进行读写操作首先必须要定义一个数据流对象指针,数据流对象指针有三种类型,它们分别是: Ifstream:表示读取文件流,使用的时候必须包含头文件"ifstream& ...

  4. mvc4 找到多个与名为“xx”的控制器匹配的类型

    asp.net mvc4 添加分区出现错误 找到多个与名为“home”的控制器匹配的类型 会出现如下错误”找到多个与名为“home”的控制器匹配的类型“ 在RouteConfig文件中添加命名空间可解 ...

  5. Microsoft Orleans 之 开发人员指南

    开发一个Grain 在开发Grain之前请先阅读Grains 这篇文章 Grain 接口 Grains通过调用各自定义在接口中的方法相互作用,一个grain实现了事先定义好的一个或多个接口,grain ...

  6. Maven基本理解

    转 maven(一) maven到底是个啥玩意~ 我记得在搞懂maven之前看了几次重复的maven的教学视频.不知道是自己悟性太低还是怎么滴,就是搞不清楚,现在弄清楚了,基本上入门了.写该篇博文,就 ...

  7. 从理论到实践,全方位认识DNS

    从理论到实践,全方位认识DNS 2015-11-23 程序员之家 作者:selfboot 原文:http://segmentfault.com/a/1190000003956853 对于 DNS(Do ...

  8. babel-preset-env: a preset that configures Babel for you

    转载 babel-preset-env is a new preset that lets you specify an environment and automatically enables t ...

  9. python 小数保留位数

    利用round(number[, ndigit] )函数四舍五入 保留浮点数的小数点. 如保留小数点后两位. num = 9.2174 new_num = round( num , 2 ) 则new_ ...

  10. action动作类的生命周期

    创建:Action动作类每次请求的时候都会创建一个实例对象 销毁:当前action动作类的请求响应完后就消失了 跟javaweb中的HttpServletRequest的生命周期是一样的,struts ...