Testing 从命令行运行空手道测试返回surefire插件错误

Testing 从命令行运行空手道测试返回surefire插件错误,testing,command-line,cucumber,bdd,karate,Testing,Command Line,Cucumber,Bdd,Karate,我一直在尝试从命令行运行我的功能空手道文件。我一直在尝试遵循以下说明: mvn test -Dtest=CatsRunner 当我运行上述命令时,我看到我的测试正在运行,并且所有测试都通过了。但是,在我的命令行末尾会弹出一些错误。以下是日志部分: 1 Scenarios (1 passed) 16 Steps (16 passed) 0m2.388s Karate version: 0.8.0 html report: (paste into browser to view) --------

我一直在尝试从命令行运行我的功能空手道文件。我一直在尝试遵循以下说明:

mvn test -Dtest=CatsRunner
当我运行上述命令时,我看到我的测试正在运行,并且所有测试都通过了。但是,在我的命令行末尾会弹出一些错误。以下是日志部分:

1 Scenarios (1 passed)
16 Steps (16 passed)
0m2.388s
Karate version: 0.8.0
html report: (paste into browser to view)
-----------------------------------------
file:/D:/Dev/xxx/yyy/karate/target/surefire-reports/TEST-tvplus.singleuseroperations.authenticate.auth-existing-IPTV-user.html

[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.302 s - in tvplus.singleuseroperations.authenticate.AuthenticateRunner
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.204 s
[INFO] Finished at: 2018-12-12T15:50:06+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project karate: No tests were executed!  
(Set -DfailIfNoTests=false to ignore this error.) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
我还在下面粘贴我的pom文件:

<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.xxx.yyy.zzz</groupId>
<artifactId>karate</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>1.8</java.version>
    <maven.compiler.version>3.6.0</maven.compiler.version>
    <karate.version>0.8.0</karate.version>
    <jdbc.version>5.1.3.RELEASE</jdbc.version>
    <maven.surefire.version>2.22.1</maven.surefire.version>
</properties>    

<dependencies>
    <dependency>
        <groupId>com.intuit.karate</groupId>
        <artifactId>karate-apache</artifactId>
        <version>${karate.version}</version>
        <scope>test</scope>
    </dependency>            
    <dependency>
        <groupId>com.intuit.karate</groupId>
        <artifactId>karate-junit4</artifactId>
        <version>${karate.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>${jdbc.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.oracle</groupId>
        <artifactId>ojdbc6</artifactId>
        <version>11.2.0.4</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.intuit.karate</groupId>
        <artifactId>karate-testng</artifactId>
        <version>${karate.version}</version>
    </dependency>
    <dependency>
        <groupId>com.intuit.karate</groupId>
        <artifactId>karate-core</artifactId>
        <version>${karate.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.12.4</version>
    </dependency>

</dependencies>

<build>
    <testResources>
        <testResource>
            <directory>src/test/java</directory>
            <excludes>
                <exclude>**/*.java</exclude>
            </excludes>
        </testResource>
    </testResources>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${maven.compiler.version}</version>
            <configuration>
                <encoding>UTF-8</encoding>
                <source>${java.version}</source>
                <target>${java.version}</target>
                <compilerArgument>-Werror</compilerArgument>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${maven.surefire.version}</version>
            <configuration>
                <argLine>-Dfile.encoding=UTF-8</argLine>
            </configuration>
        </plugin>
    </plugins>
</build>       
编辑:以下部分与问题无关。不用想了。升级空手道版本解决了这个问题。 自从在代码中添加@KarateOptions注释时遇到一些问题以来,我一直使用@CucumberOptions作为跑步者课程的首选


提前感谢。

仅在0.9.0版本中提供
@KarateOptions


编辑:如果你简化你的
pom.xml
,避免使用空手道不需要的东西,你就可以用“surefire插件”解决问题。这就是我一直试图通过指向此链接来解释的内容:

为了消除surefire插件错误,您可能需要将DfailIfNoTests=false添加到命令行运行脚本中。Surefire插件与您编写的测试集成。此选项将编译并运行您的测试,但如果某些测试失败,则不会使整个构建失败。

我已使用0.9.0版本的空手道更新了pom文件。正如你所说,我现在可以使用卡拉特选项。但是这个更新并没有解决我的问题,当我试图在终端上运行代码时,我仍然有surefire插件错误。不幸的是,我的问题不是使用karateoptions的问题。显然,正如我在标题中所说,我的问题肯定是错误的。所以我没有投赞成票,也没有接受你的答案。还没试过另一个问题的答案。请不要在这里张贴不相关的东西。你找到解决办法了吗?
package xyz;

import com.intuit.karate.junit4.Karate;
import cucumber.api.CucumberOptions;
import org.junit.runner.RunWith;

@RunWith(Karate.class)
@CucumberOptions(features = "classpath:xxx/singleuseroperations/authenticate/auth-existing-user.feature")

public class CatsRunner {
}