maven 关于maven-checkstyle-plugin报错 lifecycle confoguration

1.Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-checkstylemaven 关于maven-checkstyle-plugin报错 lifecycle confoguration_第1张图片

解决办法1:

(1)进入eclipse菜单Window->Preferences->Maven->Lifecycle Mappings,
单击Open workspace lifecycle mappings metadata按钮,新建一个lifecycle-mapping-metadata.xml文件
(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)在Window->Preferences->Maven->Lifecycle Mappings中指定好mapping file location,单击Reload workspace lifecycle mappings metadata按钮重新加载该文件。
(4)
Update Maven Project

解决办法2

包含插件的pom中的文件注释掉

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

2.eclipse中maven的基本使用

测试:
run as maven build…
goals 输入 clean test

打包:
run as maven build…
goals 输入 clean package

打包并发送到本地仓库:
run as maven build…
goals 输入 clean install

你可能感兴趣的:(错误-maven,maven)