欢迎来到DIVCSS5查找CSS资料与学习DIV CSS布局技术!
  ugin:1.8:add-test-source(execution:add-functional-source,phase:generate-sources)
 
  在maven项目中使用add-source时,pom.xml报如下错误:
 
  Pluginexecutionnotcoveredbylifecycleconfiguration:org.codehaus.mojo:build-helper-maven-plugin:1.8:add-test-source(execution:add-functional-source,phase:generate-sources)
 
  出错误代码处(红色标记)
 
  <!--增加functionaltest的Source目录-->
 
  <plugin>
 
  <groupId>org.codehaus.mojo</groupId>
 
  <artifactId>build-helper-maven-plugin</artifactId>
 
  <executions>
 
  <execution>
 
  <id>add-functional-source</id>
 
  <phase>generate-sources</phase>
 
  <goals>
 
  <goal>add-test-source</goal>
 
  </goals>
 
  <configuration>
 
  <sources>
 
  <source>src/test/functional</source>
 
  </sources>
 
  </configuration
 
  </execution>
 
  </executions>
 
  </plugin>
 
  将上述代码注释后,加入的代码如下:
 
  <pluginManagement>
 
  <plugins>
 
  <!--Thisplugin'sconfigurationisusedtostoreEclipsem2esettingsonly.IthasnoinfluenceontheMavenbuilditself.-->
 
  <plugin>
 
  <groupId>org.eclipse.m2e</groupId>
 
  <artifactId>lifecycle-mapping</artifactId>
 
  <version>1.0.0</version>
 
  <configuration>
 
  <lifecycleMappingMetadata>
 
  <pluginExecutions>
 
  <pluginExecution>
 
  <pluginExecutionFilter>
 
  <groupId>
 
  org.codehaus.mojo
 
  </groupId>
 
  <artifactId>
 
  build-helper-maven-plugin
 
  </artifactId>
 
  <versionRange>
 
  [1.8,)
 
  </versionRange>
 
  <goals>
 
  <goal>add-source</goal>
 
  </goals>
 
  </pluginExecutionFilter>
 
  <action>
 
  <ignore></ignore>
 
  </action>
 
  </pluginExecution>
 
  </pluginExecutions>
 
  </lifecycleMappingMetadata>
 
  </configuration>
 
  </plugin>
 
  </plugins>
 
  </pluginManagement>
 
  然后maven->UpdateProject即可

如需转载,请注明文章出处和来源网址:http://www.divcss5.com/html/h56946.shtml