How to Ignore Maven's Plugin Execution Not Covered by Lifecycle Configuration Warning

There are times when you want to ignore some of maven warnings or errors. To do so, normally we add the ff code in the parent project's pom.xml.

For example to ignore liferay's theme-merge and build-thumbnail goal warning.

<pluginManagement>
 <plugins>
  <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>
      <pluginExecution>
       <pluginExecutionFilter>
        <groupId>com.liferay.maven.plugins</groupId>
        <artifactId>liferay-maven-plugin</artifactId>
        <versionRange>[6.1.0,)</versionRange>
        <goals>
         <goal>theme-merge</goal>
         <goal>build-thumbnail</goal>
        </goals>
       </pluginExecutionFilter>
       <action>
        <ignore />
       </action>
      </pluginExecution>
     </pluginExecutions>
    </lifecycleMappingMetadata>
   </configuration>
  </plugin>
 </plugins>
</pluginManagement>

0 Comments

Post a Comment

Post a Comment (0)

Previous Post Next Post
NERV Open Source

Building production Spring Boot systems?

Explore NERV — open-source Java libraries for audit trails, persistence, exception handling, and reliable event-driven architecture.

Explore NERV on GitHub →