运行 jenkins 给出“包 org.junit 不存在"; [英] Running jenkins gives "package org.junit does not exist"

查看:48
本文介绍了运行 jenkins 给出“包 org.junit 不存在";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮我解决这个错误吗?

Can any one please help me with that error?

build-project:
     [echo] AntProject: /root/.jenkins/jobs/Ant/workspace/build.xml
    [javac] Compiling 2 source files to /root/.jenkins/jobs/Ant/workspace/bin
    [javac] /root/.jenkins/jobs/Ant/workspace/src/com/moi/test/junit/MaClasseTest.java:3: package org.junit does not exist
    [javac] import static org.junit.Assert.*;
    [javac]                        ^
    [javac] /root/.jenkins/jobs/Ant/workspace/src/com/moi/test/junit/MaClasseTest.java:5: package org.junit does not exist
    [javac] import org.junit.Test;
    [javac]                 ^
    [javac] /root/.jenkins/jobs/Ant/workspace/src/com/moi/test/junit/MaClasseTest.java:9: cannot find symbol
    [javac] symbol  : class Test
    [javac] location: class com.moi.test.junit.MaClasseTest
    [javac]     @Test
    [javac]      ^
    [javac] /root/.jenkins/jobs/Ant/workspace/src/com/moi/test/junit/MaClasseTest.java:12: cannot find symbol
    [javac] symbol  : method assertTrue(boolean)
    [javac] location: class com.moi.test.junit.MaClasseTest
    [javac]              assertTrue(MaClasse.additioner(2,2) == 4); 
    [javac]              ^
    [javac] 4 errors

BUILD FAILED /root/.jenkins/jobs/Ant/workspace/build.xml:35: Compile failed; see the compiler error output for details.

推荐答案

您似乎忘记在 classparh 中提供 junit 库

it seems you forgot to make junit library available in your classparh

这篇关于运行 jenkins 给出“包 org.junit 不存在";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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