当我尝试使用最新的依赖项构建Maven空手道项目时出现编译错误 [英] Compilation errors when i try to build Maven karate project with latest Dependencies

查看:67
本文介绍了当我尝试使用最新的依赖项构建Maven空手道项目时出现编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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上正常工作,我将其更改为最新版本.但现在即使对于上一个也不起作用.

Appreciate if anyone can help me on this. This is compiled and worked fine with 0.6.0 and I change it to the latest version. but now it's not working even for the previous one.

使用以下命令查找我下面的PoM文件:http://maven.apache.org/xsd/maven-4.0.0.xsd>4.0.0

Find the bellow PoM file I m using : 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] ----------------------------------------------------------------

推荐答案

类似您本地maven存储库的声音已损坏,因此请尝试清理并重新下载JAR-s.您可以使用以下命令 依赖项:purge-local-repository

Sounds like your local maven repository is corrupted so try to clean and re-download the JAR-s. You can use this command dependency:purge-local-repository

这篇关于当我尝试使用最新的依赖项构建Maven空手道项目时出现编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆