找不到m2e生命周期映射 [英] m2e lifecycle-mapping not found

查看:149
本文介绍了找不到m2e生命周期映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试使用此处所述的解决方案解决烦人的放置在生命周期配置之外的插件执行:org.codehaus.mojo:build-helper-maven-plugin:1.7:add-source(执行:默认,阶段:generate-sources)"的问题我的pom.xml上的插件:

I am trying to use the solution described here to solve the annoying "Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:build-helper-maven-plugin:1.7:add-source (execution: default, phase: generate-sources)" when I place the following plugin on my pom.xml:

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
    <execution>
        <phase>generate-sources</phase>
        <goals><goal>add-source</goal></goals>
        <configuration>
            <sources>
                <source>src/bootstrap/java</source>
            </sources>
        </configuration>
    </execution>
</executions>
</plugin>

但是当我运行mvn clean install时,我得到了这个信息:

But when I run mvn clean install I get this:

原因:在存储库中找不到POM'org.eclipse.m2e:lifecycle-mapping':无法从任何存储库下载工件

Reason: POM 'org.eclipse.m2e:lifecycle-mapping' not found in repository: Unable to download the artifact from any repository

有人知道如何使m2e和maven开心吗?

Does anyone have a clue on how to make m2e and maven happy?

推荐答案

org.eclipse.m2e:lifecycle-mapping插件实际上不存在.应该在pom.xml<build><pluginManagement>部分中使用它.这样,它就不会被Maven解析,而是可以被m2e读取.

The org.eclipse.m2e:lifecycle-mapping plugin doesn't exist actually. It should be used from the <build><pluginManagement> section of your pom.xml. That way, it's not resolved by Maven but can be read by m2e.

但是,要解决您的问题,更实际的解决方案是在Eclipse中安装m2e构建帮助器连接器.您可以从Window> Preferences> Maven> Discovery> Open Catalog安装它.这样,build-helper-maven-plugin:add-sources将在日食中被调用,而无需您更改pom.xml.

But a more practical solution to your problem would be to install the m2e build-helper connector in eclipse. You can install it from the Window > Preferences > Maven > Discovery > Open Catalog. That way build-helper-maven-plugin:add-sources would be called in eclipse without having you to change your pom.xml.

这篇关于找不到m2e生命周期映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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