POM Error: Plugin execution not covered by lifecycle…

This topic contains 9 replies, has 4 voices, and was last updated by Profile photo of sathyamca sathyamca 5 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #338436 Reply
    Profile photo of bijurk
    bijurk
    Participant

    Hello:

    After upgrading to the MyEclipse 2013, the POM shows an error stating:
    “Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-antrun-plugin:1.7:run (execution: CopyPropertyFiles, phase: generate-resources)”
    for the following build segment of the POM:

    
        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.7</version>
                    <executions>
                        <execution>
                            <id>CopyPropertyFiles</id>
                            <phase>generate-resources</phase>
                            <goals>
                                <goal>run</goal>
                            </goals>
                            <configuration>
                                <target>
                                    <copy todir="${basedir}/src/main/resources" overwrite="true">
                                        <fileset id="envpropfiles" dir="${basedir}/src/main/resources/properties">
                                            <include name="${env}-*.properties" />
                                        </fileset>
                                        <mapper type="regexp" from="(.*)-(.*\.properties)" to="] -->" />
                                    </copy>
                                </target>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
    

    While this does not seem to be affecting the actual Maven Install run, it is an irritant and may mask other errors if the POM file is ignored.

    Any ideas?

    Cheers,
    Biju

    #338447 Reply
    Profile photo of support-swapna
    support-swapna
    Moderator

    Biju,

    This is an M2eclipse problem. You are seeing it in MyEclipse as Maven4MyEclipse depends on M2Eclipse.

    Add <pluginManagement> to pom.xml just above the <plugins> element to make the error go away.

    So your pom.xml should be :

    <build>
    <pluginManagement>
          <plugins>
             <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.7</version>
                <executions>
                   <execution>
                      <id>CopyPropertyFiles</id>
                      <phase>generate-resources</phase>
                      <goals>
                         <goal>run</goal>
                      </goals>
                      <configuration>
                         <target>
                            <copy todir="${basedir}/src/main/resources" overwrite="true">
                               <fileset id="envpropfiles" dir="${basedir}/src/main/resources/properties">
                                  <include name="${env}-*.properties" />
                               </fileset>
                               <mapper type="regexp" from="(.*)-(.*\.properties)" to="] -->" />
                            </copy>
                         </target>
                      </configuration>
                   </execution>
                </executions>
             </plugin> 
        </plugins>
      </pluginManagement>
    </build>

    Let us know how it works for you.

    #338501 Reply
    Profile photo of bijurk
    bijurk
    Participant

    Swapna:

    While this removed the error displayed, it did not execute the CopyPropertyFiles. So this solution does not work in our case.

    I am wondering why this did not show up as an issue with version ME10.7.1

    Any other ways to fix this?

    Thanks,
    Biju

    #338517 Reply
    Profile photo of support-swapna
    support-swapna
    Moderator

    Biju,

    I have filed a PR for the dev team to look into it.

    Can you please try the quick fix option :” Mark goal run as ignored in Eclipse build in Eclipse preferences” and see how it works for you.

    Alternatively you can make changes to your pom.xml to fix the issue as below :

    <build>
       <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.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <versionRange>[1.7,)</versionRange>
                        <goals>
                          <goal>run</goal>
                        </goals>
                      </pluginExecutionFilter>
                      <action>
                        <ignore />
                      </action>
                    </pluginExecution>
                  </pluginExecutions>
                </lifecycleMappingMetadata>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
        <plugins>
             <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.7</version>
                <executions>
                   <execution>
                      <id>CopyPropertyFiles</id>
                      <phase>generate-resources</phase>
                      <goals>
                         <goal>run</goal>
                      </goals>
                      <configuration>
                         <target>
                            <copy todir="${basedir}/src/main/resources" overwrite="true">
                               <fileset id="envpropfiles" dir="${basedir}/src/main/resources/properties">
                                  <include name="${env}-*.properties" />
                               </fileset>
                               <mapper type="regexp" from="(.*)-(.*\.properties)" to="] -->" />
                            </copy>
                         </target>
                      </configuration>
                   </execution>
                </executions>
             </plugin>
    #338613 Reply
    Profile photo of bijurk
    bijurk
    Participant

    Yes, this works and clears out the error from the list of Problems.

    Thanks,
    Biju

    #338641 Reply
    Profile photo of support-swapna
    support-swapna
    Moderator

    Biju,

    Glad that it is working fine.
    Do let us know if you see any issues.

    #473024 Reply
    Profile photo of javadeveloper007
    javadeveloper007
    Participant

    Hello Every one, I am getting this error on goal assemble. I know this is M2E issue but kindly have a look at it and explain me how to resolve this issue…
    Plugin execution not covered by lifecycle configuration: com.webcohesion.enunciate:enunciate-maven-plugin:2.1.0:assemble (execution: default, phase: process-sources)

    #473025 Reply
    Profile photo of javadeveloper007
    javadeveloper007
    Participant
    #473064 Reply
    Profile photo of support-swapna
    support-swapna
    Moderator

    javadeveloper007,

    Sorry that you are seeing this issue.

    1. Right click on the project > Maven > Update Project and check if it fixes the issue.

    2. Can you please clarify if you have tried the suggestions in my responses to bijurk?

    a. Add to pom.xml just above the element to make the error go away.
    b. Try the quick fix option :” Mark goal run as ignored in Eclipse build in Eclipse preferences”

    3. Please share with us the MyEclipse Installation Details from menu MyEclipse > Installation Summary > Installation Details to help us investigate further.

    Let us know how it works for you.

    –Swapna
    MyEclipse Support

    #506794 Reply
    Profile photo of sathyamca
    sathyamca
    Participant

    Hi Swapna,

    File copying issue , finally i found the solution from your valuable input. Thank you very much. God Bless You!

    Regards,
    Sathiya

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: POM Error: Plugin execution not covered by lifecycle…