0
Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:selenium-maven-plugin:2.3:xvfb (execution: xvfb, phase: test-compile)

我试过这个:生命周期配置maven错误未涵盖插件执行,但没有帮助

这是我的 pom.xml。错误信息出现在<执行>点头

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
<!-- asd -->
  <groupId>com.pragmaticqa.tests</groupId>
  <artifactId>functionalTests</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>
  <name>functionalTests</name>
  <url>http://maven.apache.org</url>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <displayProps>target/selenium/display.properties</displayProps>
  </properties>
  <dependencies>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-firefox-driver</artifactId>
        <version>2.32.0</version>
    </dependency>  
        <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.32.0</version>
    </dependency>  
    <dependency>
          <groupId>org.testng</groupId>
          <artifactId>testng</artifactId>
          <version>6.8</version>
          <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>net.sf.opencsv</groupId>
        <artifactId>opencsv</artifactId>
        <version>2.0</version>
    </dependency>
    <dependency>
  <groupId>org.apache.maven.surefire</groupId>
  <artifactId>surefire</artifactId>
  <version>2.5</version>
  <type>pom</type>
</dependency>
  </dependencies>
  <build>
  <plugins>
      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>2.5</version>
        <configuration>
               <includes>
                  <include>**/*Test*.java</include>
               </includes>
        </configuration>
     </plugin>
    <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>selenium-maven-plugin</artifactId>
            <version>2.3</version>
           <!-- execution code would go here if needed -->
            <executions>
                <execution>
                    <id>xvfb</id>
                    <phase>test-compile</phase>
                    <goals>
                        <goal>xvfb</goal>
                    </goals>
                    <configuration>
                       <!-- <displayPropertiesFile>${displayProps}</displayPropertiesFile> --> 
                       <!--  try removing the plugin declaration, try 0 or :0 -->
                       <display>:0</display>
                    </configuration>
                </execution> 
            </executions>  
        </plugin>
   </plugins>
   </build>
</project>
4

1 回答 1

1
<build>
    <pluginManagement>
        <plugins>
            <plugin> ... </plugin>
            <plugin> ... </plugin>
                  ....
        </plugins>
    </pluginManagement>
</build>

一旦这个结构到位,错误就会消失。

于 2013-07-24T12:47:32.353 回答