How to eliminate the “maven-enforcer-plugin (goal ”enforce“) is ignored by m2e” warning by eclipse?

后端 未结 6 1948

I am configuring a multi-module parent child maven project using maven and eclipse m2e, I am using the latest stuff from eclipse Juno SR1 which is m2e 1.2.0

the par

6条回答
  •  没有蜡笔的小新
    2020-12-23 20:22

    How to eliminate the “maven-enforcer-plugin (goal ”enforce“) is ignored by m2e” warning by eclipse?

    Although the eclipse lifecycle-mapping plugin has worked for me on other projects, I can't change the pom.xml since I am currently working in an IntelliJ shop with my covert instance of Eclipse and I don't want to expose myself by changing all of their pom files to include anything from group org.eclipse.m2e.

    After some experimentation, I've found that you can get this warning to not show up by changing the Lifecycle Mappings in the Maven preferences. Frankly I'm not 100% sure what this is doing but I've not seen any side effects so...

    1. In Eclipse, go to: Preferences → Maven → Lifecycle Mappings.
    2. Clicking Open workspace lifecycle mappings metadata which will open the lifecycle-mapping-metadata.xml file in a tab in the background. I assume that this cooresponds to the following file under your workspace subdir:

      .metadata/.plugins/org.eclipse.m2e.core/lifecycle-mapping-metadata.xml
      
    3. Next add the following stanza to the bottom of the file inside of ....

      
          
              org.apache.maven.plugins
              maven-enforcer-plugin
              [1.0.0,)
              
                  enforce
              
          
          
              
          
      
      
    4. Once the XML file is saved you will need to go back to the preferences window and press Reload workspace lifecycle mappings metadata which compiles the file somehow.

    5. Finally you will need to do a maven update-project on all of your projects to see the warnings go away.

    Hope this helps.

提交回复
热议问题