Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/310.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/4/jquery-ui/2.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 与Maven和Jenkins一起进行空手道Api测试_Java_Eclipse_Maven_Jenkins_Karate - Fatal编程技术网

Java 与Maven和Jenkins一起进行空手道Api测试

Java 与Maven和Jenkins一起进行空手道Api测试,java,eclipse,maven,jenkins,karate,Java,Eclipse,Maven,Jenkins,Karate,我正在使用空手道教程中提到的空手道默认原型,并使用Eclipse成功地使用cucumber报告运行测试,但是当我在Jenkins中使用相同的项目时,我得到了以下错误。 我正在使用Java1.8和Cucumber报告工具,请帮助我解决这个问题,因为我怀疑这是项目结构的问题 <===[JENKINS REMOTING CAPACITY]===>channel started Executing Maven: -B -f D:\CogsdaleWorkspace\karate-a

我正在使用空手道教程中提到的空手道默认原型,并使用Eclipse成功地使用cucumber报告运行测试,但是当我在Jenkins中使用相同的项目时,我得到了以下错误。 我正在使用Java1.8和Cucumber报告工具,请帮助我解决这个问题,因为我怀疑这是项目结构的问题

    <===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven:  -B -f D:\CogsdaleWorkspace\karate-archetype\pom.xml clean test
[INFO] Scanning for projects...
[INFO] 
[INFO] ----------------------< com.mycompany:myproject >-----------------------
[INFO] Building myproject 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ myproject ---
[INFO] Deleting D:\CogsdaleWorkspace\karate-archetype\target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ myproject ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\CogsdaleWorkspace\karate-archetype\src\main\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.0:compile (default-compile) @ myproject ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ myproject ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 10 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.0:testCompile (default-testCompile) @ myproject ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to D:\CogsdaleWorkspace\karate-archetype\target\test-classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /D:/CogsdaleWorkspace/karate-archetype/src/test/java/nexusportalapi/TestParallel.java:[3,24] package org.junit does not exist
[ERROR] /D:/CogsdaleWorkspace/karate-archetype/src/test/java/nexusportalapi/TestParallel.java:[3,1] static import only from classes and interfaces
[ERROR] /D:/CogsdaleWorkspace/karate-archetype/src/test/java/nexusportalapi/TestParallel.java:[11,17] package org.junit does not exist
[ERROR] /D:/CogsdaleWorkspace/karate-archetype/src/test/java/nexusportalapi/TestParallel.java:[34,10] cannot find symbol
  symbol:   class Test
  location: class nexusportalapi.TestParallel
[INFO] 4 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.046 s
[INFO] Finished at: 2019-12-18T07:25:48-06:00
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:testCompile (default-testCompile) on project myproject: Compilation failure: Compilation failure:
[ERROR] /D:/CogsdaleWorkspace/karate-archetype/src/test/java/nexusportalapi/TestParallel.java:[3,24] package org.junit does not exist
[ERROR] /D:/CogsdaleWorkspace/karate-archetype/src/test/java/nexusportalapi/TestParallel.java:[3,1] static import only from classes and interfaces
[ERROR] /D:/CogsdaleWorkspace/karate-archetype/src/test/java/nexusportalapi/TestParallel.java:[11,17] package org.junit does not exist
[ERROR] /D:/CogsdaleWorkspace/karate-archetype/src/test/java/nexusportalapi/TestParallel.java:[34,10] cannot find symbol
[ERROR] symbol:   class Test
[ERROR] location: class nexusportalapi.TestParallel
[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

频道已启动
正在执行Maven:-B-fd:\CogsdaleWorkspace\karate原型\pom.xml清理测试
[信息]正在扫描项目。。。
[信息]
[信息]------------------------------------------------
[信息]正在构建myproject 1.0-SNAPSHOT
[信息]------------------------------------[jar]---------------------------------
[信息]
[信息]---maven clean插件:2.5:clean(默认清洁)@myproject---
[信息]删除D:\CogsdaleWorkspace\karate原型\target
[信息]
[信息]---maven资源插件:2.6:resources(默认资源)@myproject---
[信息]使用“UTF-8”编码复制筛选的资源。
[信息]跳过不存在的资源目录D:\CogsdaleWorkspace\KarateArchetype\src\main\resources
[信息]
[信息]---maven编译器插件:3.6.0:compile(默认编译)@myproject---
[信息]无需编译-所有类都是最新的
[信息]
[信息]---maven资源插件:2.6:testResources(默认testResources)@myproject---
[信息]使用“UTF-8”编码复制筛选的资源。
[信息]正在复制10个资源
[信息]
[信息]---maven编译器插件:3.6.0:testCompile(默认testCompile)@myproject---
[信息]检测到更改-重新编译模块!
[信息]正在将1个源文件编译为D:\CogsdaleWorkspace\karate原型\target\test类
[信息]-------------------------------------------------------------
[错误]编译错误:
[信息]-------------------------------------------------------------
[错误]/D:/CogsdaleWorkspace/karate archetype/src/test/java/nexusportalapi/TestParallel.java:[3,24]包org.junit不存在
[错误]/D:/CogsdaleWorkspace/karate archetype/src/test/java/nexusportalapi/TestParallel.java:[3,1]仅从类和接口静态导入
[错误]/D:/CogsdaleWorkspace/karate archetype/src/test/java/nexusportalapi/TestParallel.java:[11,17]包org.junit不存在
[错误]/D:/CogsdaleWorkspace/karate原型/src/test/java/nexusportalapi/TestParallel.java:[34,10]找不到符号
符号:班级考试
位置:类nexusportalapi.TestParallel
[信息]4个错误
[信息]-------------------------------------------------------------
[信息]------------------------------------------------------------------------
[信息]生成失败
[信息]------------------------------------------------------------------------
[信息]总时间:4.046秒
[信息]完成时间:2019-12-18T07:25:48-06:00
[信息]------------------------------------------------------------------------
等待Jenkins完成数据收集
[错误]无法在项目myproject上执行目标org.apache.maven.plugins:maven编译器插件:3.6.0:testCompile(默认testCompile):编译失败:编译失败:
[错误]/D:/CogsdaleWorkspace/karate archetype/src/test/java/nexusportalapi/TestParallel.java:[3,24]包org.junit不存在
[错误]/D:/CogsdaleWorkspace/karate archetype/src/test/java/nexusportalapi/TestParallel.java:[3,1]仅从类和接口静态导入
[错误]/D:/CogsdaleWorkspace/karate archetype/src/test/java/nexusportalapi/TestParallel.java:[11,17]包org.junit不存在
[错误]/D:/CogsdaleWorkspace/karate原型/src/test/java/nexusportalapi/TestParallel.java:[34,10]找不到符号
[错误]符号:类测试
[错误]位置:类nexusportalapi.TestParallel
[错误]->[帮助1]
[错误]
[错误]要查看错误的完整堆栈跟踪,请使用-e开关重新运行Maven。
[错误]使用-X开关重新运行Maven以启用完整调试日志记录。
[错误]
[错误]有关错误和可能的解决方案的更多信息,请阅读以下文章:
[错误][帮助1]http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
POM文件

`http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0

<groupId>com.mycompany</groupId>
<artifactId>myproject</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.9.4</karate.version>
</properties>

<dependencies>
    <dependency>
        <groupId>com.intuit.karate</groupId>
        <artifactId>karate-apache</artifactId>
        <version>${karate.version}</version>

    </dependency>
    <dependency>
        <groupId>com.intuit.karate</groupId>
        <artifactId>karate-junit5</artifactId>
        <version>${karate.version}</version>

    </dependency>
    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>5.4.0</version>

    </dependency>
    <dependency>
        <groupId>net.masterthought</groupId>
        <artifactId>cucumber-reporting</artifactId>
        <version>5.0.0</version>

    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>2.1</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>2.22.2</version>
        </plugin>

    </plugins>


</build>
com.mycompany
我的项目
1.0-快照
罐子
UTF-8
1.8
3.6.0
0.9.4
空手道
空手道阿帕奇
${karate.version}
空手道
空手道-junit5
${karate.version}
org.junit.jupiter
朱尼特木星发动机
5.4.0
网络智囊团
黄瓜报道
5.0.0
org.apache.logging.log4j
log4j型芯
2.1
src/test/java
**/*.爪哇
org.apache.maven.plugins
maven编译器插件
${maven.compiler.version}
UTF-8
${java.version}
${java.version}
-沃罗
org.apache.maven.plugins
maven surefire插件
2.22.2

仅凭这些信息很难判断,你能试试两件事吗:

  • 升级至空手道版本
    0.9.5.RC5
  • 使用我们现有的版本 测试黄瓜报告库:3.8.0-

您正处于解决此问题的最佳位置,但如果所有其他操作都失败,您可以尝试按照此过程进行操作:

仅凭此信息很难判断,您可以尝试两种方法:

  • 升级至空手道版本
    0.9.5.RC5
  • 使用我们现有的版本 测试黄瓜报告库:3.8.0-

您正处于解决此问题的最佳位置,但如果所有其他操作都失败,您可以尝试按照此流程进行操作:

谢谢,我也尝试过,但仍然得到了相同的结果issue@SeleniumIsLove请参阅上面的最后一个链接,所有最佳链接