Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 通过cron作业运行pom.xml时出现此错误;org.apache.maven.surefire.booter.SurefireExecutionException:provider中的异常;_Java_Maven - Fatal编程技术网

Java 通过cron作业运行pom.xml时出现此错误;org.apache.maven.surefire.booter.SurefireExecutionException:provider中的异常;

Java 通过cron作业运行pom.xml时出现此错误;org.apache.maven.surefire.booter.SurefireExecutionException:provider中的异常;,java,maven,Java,Maven,我正在centos机器上运行基于selenium maven的项目。我正在使用这个命令“mvn clean test”来运行脚本 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire- plugin:2.20:test (default-test) on project BaTAutomation: There are test failures. [ERROR] Please refer to

我正在centos机器上运行基于selenium maven的项目。我正在使用这个命令“mvn clean test”来运行脚本

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-   plugin:2.20:test (default-test) on project BaTAutomation: There are test failures.    
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump,    
[ERROR] Exception in provider
[ERROR] org.apache.maven.surefire.booter.SurefireExecutionException: Exception in provider
[ERROR] at org.apache.maven.plugin.surefire.InPluginVMSurefireStarter.runSuitesInProcess(InPluginVMSurefireStarter.java:88)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1060)
有人能告诉我为什么我会犯这个错误吗

我的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>com.indusface.testtas</groupId>
  <artifactId>BaTAutomation</artifactId>
  <version>0.0.1-SNAPSHOT</version>
   <url>http://maven.apache.org</url>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
  <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>3.4.0</version>
    </dependency>
  <dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>6.11</version>
  </dependency> 
  <dependency>
    <groupId>log4j</groupId>
    <artifactId>log4j</artifactId>
    <version>1.2.17</version>
  </dependency>
  <dependency>
    <groupId>com.amazonaws</groupId>
    <artifactId>aws-java-sdk</artifactId>
    <version>1.11.98</version>
</dependency>
  <dependency>
    <groupId>commons-configuration</groupId>
    <artifactId>commons-configuration</artifactId>
    <version>1.10</version>
  </dependency>
  <dependency>
    <groupId>com.relevantcodes</groupId>
    <artifactId>extentreports</artifactId>
    <version>2.41.2</version>
   </dependency>
    <dependency>
    <groupId>javax.activation</groupId>
    <artifactId>activation</artifactId>
    <version>1.1</version>
</dependency>
<dependency>
    <groupId>javax.mail</groupId>
    <artifactId>mail</artifactId>
    <version>1.4</version>
</dependency>
  </dependencies>
  <build>
        <plugins>
            <!-- Following plugin executes the testng tests -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.20</version>
                <configuration>
                     <forkMode>never</forkMode>
                    <!-- Suite testng xml file to consider for test execution -->
                    <suiteXmlFiles>
                             <suiteXmlFile>TestNG.xml</suiteXmlFile>
                     </suiteXmlFiles>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
   </project>

4.0.0
com.industface.testtas
蝙蝠自动化
0.0.1-快照
http://maven.apache.org
UTF-8
org.seleniumhq.selenium
硒爪哇
3.4.0
org.testng
testng
6.11
log4j
log4j
1.2.17
亚马逊网站
aws java sdk
1.11.98
共用配置
共用配置
1.10
相关代码
扩展端口
2.41.2
javax.activation
激活
1.1
javax.mail
邮件
1.4
org.apache.maven.plugins
maven surefire插件
2.20
从未
TestNG.xml
maven编译器插件
3.6.1
1.8
1.8

请告诉我pom.xml文件中是否有任何错误,我的问题已得到解决。我已重新启动centos计算机,这就是为什么我的centos计算机显示发生了更改。因此,我遇到了上述问题。在更改为更新显示后,它工作正常

我创建了一个shell脚本,它将从存储库下载我的selenium项目并运行selenium脚本。当我手动运行shell脚本时,它工作正常。但是当我尝试通过cronjob运行shell脚本时,它不起作用。它可以从存储库下载项目,但无法运行selenium脚本。