异常处理:Eclipse下解决Plugin execution not covered by lifecycle configuration异常

异常描述:

今天尝试导入涛哥的ES源码,使用sts3.3.0,发现如下错误:

[html]  view plain copy print ?
  1. Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:properties-maven-plugin:1.0-alpha-1:write-project-properties (execution: default, phase:   
  2.  generate-resources)  

原因是eclipse的m2e插件还没有支持到execution:http://wiki.eclipse.org/M2E_plugin_execution_not_covered

解决办法如下。


修改前的配置:

[html]  view plain copy print ?
  1. <build>   
  2.   <plugins>  
  3.     <plugin>  
  4.       <groupId>org.codehaus.mojo</groupId>  
  5.       <artifactId>properties-maven-plugin</artifactId>  
  6.       <version>1.0-alpha-1</version>  
  7.       <executions>  
  8.         <execution>  
  9.           <phase>generate-resources</phase>  
  10.           <goals>  
  11.             <goal>write-project-properties</goal>  
  12.           </goals>  
  13.           <configuration>  
  14.             <outputFile>${project.build.outputDirectory}/org/apache/vysper/xmpp/server/vysperserver.properties  
  15.             </outputFile>  
  16.           </configuration>  
  17.         </execution>  
  18.       </executions>  
  19.     </plugin>  
  20.   </plugins>  
  21. </build>  

修改之后的配置:

[html]  view plain copy print ?
  1. <build>  
  2.         <pluginManagement>  
  3.             <plugins>  
  4.                 <!--This plugin's configuration is used to store Eclipse m2e settings   
  5.                     only. It has no influence on the Maven build itself. -->  
  6.                 <plugin>  
  7.                     <groupId>org.eclipse.m2e</groupId>  
  8.                     <artifactId>lifecycle-mapping</artifactId>  
  9.                     <version>1.0.0</version>  
  10.                     <configuration>  
  11.                         <lifecycleMappingMetadata>  
  12.                             <pluginExecutions>  
  13.                                 <pluginExecution>  
  14.                                     <pluginExecutionFilter>  
  15.                                         <groupId>org.codehaus.mojo</groupId>  
  16.                                         <artifactId>aspectj-maven-plugin</artifactId>  
  17.                                         <versionRange>[1.0,)</versionRange>  
  18.                                         <goals>  
  19.                                             <goal>test-compile</goal>  
  20.                                             <goal>compile</goal>  
  21.                                         </goals>  
  22.                                     </pluginExecutionFilter>  
  23.                                     <action>  
  24.                                         <execute />  
  25.                                     </action>  
  26.                                 </pluginExecution>  
  27.                             </pluginExecutions>  
  28.                         </lifecycleMappingMetadata>  
  29.                     </configuration>  
  30.                 </plugin>  
  31.                 <plugin>  
  32.                     <groupId>org.codehaus.mojo</groupId>  
  33.                     <artifactId>properties-maven-plugin</artifactId>  
  34.                     <version>1.0-alpha-1</version>  
  35.                     <executions>  
  36.                         <execution>  
  37.                             <phase>generate-resources</phase>  
  38.                             <goals>  
  39.                                 <goal>write-project-properties</goal>  
  40.                             </goals>  
  41.                             <configuration>  
  42.                                 <outputFile>${project.build.outputDirectory}/org/apache/vysper/xmpp/server/vysperserver.properties  
  43.                                 </outputFile>  
  44.                             </configuration>  
  45.                         </execution>  
  46.                     </executions>  
  47.                 </plugin>  
  48.             </plugins>  
  49.         </pluginManagement>  
  50.     </build>  

参考:http://stackoverflow.com/questions/6352208/how-to-solve-plugin-execution-not-covered-by-lifecycle-configuration-for-sprin

你可能感兴趣的:(异常处理:Eclipse下解决Plugin execution not covered by lifecycle configuration异常)