当我尝试使用最新的Dependencies构建Maven空手道项目时出现编译错误

时间:2018-05-23 20:31:33

标签: maven-3 pom.xml karate

I m new to Karate API automation tool and just try to set up the tool.I'm getting Compilation errors when I try to compile (Clean install ) my maven project. 

感谢是否有人可以帮助我。这是使用0.6.0编译和工作正常,我将其更改为最新版本。但是现在它甚至不能用于前一个。

找到我正在使用的波纹管PoM文件:  http://maven.apache.org/xsd/maven-4.0.0.xsd">         4.0.0

    <groupId>com.test.karate</groupId>
    <artifactId>Examples</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>
 <dependencies>
        <dependency>
            <groupId>com.intuit.karate</groupId>
            <artifactId>karate-apache</artifactId>
            <version>0.8.0.RC3</version>
            <scope>test</scope>
        </dependency>            
        <dependency>
            <groupId>com.intuit.karate</groupId>
            <artifactId>karate-junit4</artifactId>
            <version>0.8.0.RC3</version>
            <scope>test</scope>
        </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>

**Console log :** 
Building Examples 0.0.1-SNAPSHOT
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /Users/XXX/eclipse-workspace/Examples/src/main/java/Ru`enter code here`nnerKarate.java:[3,24] package org.junit.runner does not exist
[ERROR] /Users/XXX/eclipse-workspace/Examples/src/main/java/RunnerKarate.java:[5,1] package com.intuit.karate.junit4 does not exist
[ERROR] /Users/XXX/eclipse-workspace/Examples/src/main/java/RunnerKarate.java:[7,20] package cucumber.api does not exist
[ERROR] /Users/XXX/eclipse-workspace/Examples/src/main/java/RunnerKarate.java:[8,26] package cucumber.api.junit does not exist
[ERROR] /Users/uwickdi/eclipse-workspace/Examples/src/main/java/RunnerKarate.java:[10,2] cannot find symbol
  symbol: class RunWith
[ERROR] /Users/XXX/eclipse-workspace/Examples/src/main/java/RunnerKarate.java:[11,2] cannot find symbol
  symbol: class CucumberOptions
[INFO] 6 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ----------------------------------------------------------------

1 个答案:

答案 0 :(得分:1)

听起来您的本地maven存储库已损坏,因此请尝试清理并重新下载JAR-s。您可以使用此命令dependency:purge-local-repository