进入eclipse菜单Window->Preferences->Maven->Lifecycle Mappings, 单击Open workspace lifecycle mappings metadata按钮,新建一个lifecycle-mapping-metadata.xml文件
编辑lifecycle-mapping-metadata.xml内容如下并保存:
<?xml version="1.0" encoding="UTF-8"?> <lifecycleMappingMetadata> <pluginExecutions> <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> <pluginExecution> <pluginExecutionFilter> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> <goals> <goal>parse-version</goal> </goals> <versionRange>[0.0,)</versionRange> </pluginExecutionFilter> <action> <ignore/> </action> </pluginExecution> </pluginExecutions> </lifecycleMappingMetadata>在Window->Preferences->Maven->Lifecycle Mappings中指定好mapping file location,单击Reload workspace lifecycle mappings metadata按钮重新加载该文件。
Update Maven Project (或Alt+F5)可解决