无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.19:test

时间:2015-12-05 08:13:13

标签: java eclipse maven jenkins

执行测试时构建失败

这是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>
  <groupId>localweb</groupId>
  <artifactId>localweb</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <build>
    <plugins>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.3.2</version>
    <configuration>
    <source>1.7</source>
    <target>1.7</target>
    </configuration>
    </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.19</version>
            <inherited>true</inherited>
            <configuration>
            <skip>false</skip>
                <suiteXMLFiles>
                    <suiteXMLFile>testng.xml</suiteXMLFile>
                </suiteXMLFiles>
            </configuration>
                        <goals>
          <goal>test</goal>
        </goals>
        </plugin>
    </plugins>
</build>
  <dependencies>            
    <dependency>              
         <groupId>junit</groupId>                               
         <artifactId>junit</artifactId>                             
         <version>3.8.1</version>                               
         <scope>test</scope>                                
    </dependency>             
    <dependency>              
        <groupId>org.seleniumhq.selenium</groupId>                              
        <artifactId>selenium-java</artifactId>                              
        <version>2.45.0</version>                               
    </dependency>             
    <dependency>              
        <groupId>org.testng</groupId>                               
        <artifactId>testng</artifactId>                             
        <version>6.8</version>                              
        <scope>test</scope>                                     
   </dependency>
</dependencies>
</project>

这是Root POM /home/user/workspace/localweb/pom.xml

当我使用'Run as Maven Build'在eclipse中执行这个项目时,Build就成功了。只有在通过Jenkins执行时,Build才会失败。

0 个答案:

没有答案
相关问题