get rid of POM not found warning for org.eclipse.m2e:lifecycle-mapping

前端 未结 5 2000
攒了一身酷
攒了一身酷 2020-12-04 11:19

With intent to get m2e 1.0 working correctly I have had to specify the lifecycle mapping:

    
        
            &l         


        
相关标签:
5条回答
  • 2020-12-04 11:41

    m2eclipse 1.7.0 introduced an alternative, namely an XML processing instruction.

    In the original example, you would simply “annotate” every <execution> of the maven-processor-plugin’s process goal with

    <?m2e execute?>
    

    See the release notes for more details on the syntax and further options.

    0 讨论(0)
  • 2020-12-04 11:49

    This solution is now deprecated, I would recommend using the "profile" solution by @ctrueden which is the accepted answer!

    While not the most clean solution, when you use a repository manager in your company or are on your own, in the mean time you may do this: - Checkout https://github.com/mfriedenhagen/dummy-lifecycle-mapping-plugin. - Run mvn install when you are on your own - Run mvn deploy -DaltDeploymentRepository=REPO_ID::default::YOUR_THIRDPARTY_REPO_URL when you have a repository manager like Nexus or Artifactory. - See https://github.com/mfriedenhagen/dummy-lifecycle-mapping-plugin/blob/master/README.creole as well.

    Regards Mirko

    0 讨论(0)
  • 2020-12-04 11:50

    My team works around this problem by wrapping the relevant configuration in a profile:

    <profile>
      <id>only-eclipse</id>
      <activation>
        <property>
          <name>m2e.version</name>
        </property>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.eclipse.m2e</groupId>
              <artifactId>lifecycle-mapping</artifactId>
              <version>1.0.0</version>
              <configuration>
                ...
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
    
    0 讨论(0)
  • 2020-12-04 11:56

    This a known bug with WONTFIX resolution. The suggested solution is the simplest in my opinion:

    mvn archetype:generate -DgroupId=org.eclipse.m2e -DartifactId=lifecycle-mapping \
     -Dversion=1.0.0 -DarchetypeArtifactId=maven-archetype-mojo
    

    and install this project.

    0 讨论(0)
  • 2020-12-04 12:01

    Now there's now better solution (for the error messages in Eclipse only).

    Press CTR+1 on the error Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:buildnumber-maven-plugin:1.1:create-timestamp (execution: default-create-timestamp, phase: validate) and then select this option:

    enter image description here

    This works with org.eclipse.m2e.editor.xml_1.2.0.20120903-1050.jar plugin (maybe earlier also)

    0 讨论(0)
提交回复
热议问题