Maven reports an error lifecycle confoguration about maven-checkstyle-plugin

1.Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-checkstyleProblem picture

Solution 1:

(1) Enter the eclipse menu Window->Preferences->Maven->Lifecycle Mappings,
click the Open workspace lifecycle mappings metadata button, and create a new lifecycle-mapping-metadata.xml file
(2)

<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
  <pluginExecutions>
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <goals>
          <goal>create-timestamp</goal>
        </goals>
        <versionRange>[0.0,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>

	<pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <goals>
          <goal>check</goal>
        </goals>
        <versionRange>[0.0,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <ignore/>
      </action>
    </pluginExecution> 
  </pluginExecutions>
</lifecycleMappingMetadata>

(3) Specify the mapping file location in Window->Preferences->Maven->Lifecycle Mappings, and click the Reload workspace lifecycle mappings metadata button to reload the file.
(4)
Update Maven Project

Solution 2

The file in the pom containing the plugin is commented out

<!-- <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                ....

2. The basic use of maven in eclipse

Test:
run as maven build...
goals enter clean test

Package:
run as maven build…
goals enter clean package

Package and send to the local warehouse:
run as maven build…
goals enter clean install

Guess you like

Origin blog.csdn.net/liyang_nash/article/details/107993611