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

问题描述

任何一个可以请帮我的错误?

 建设项目:
     [回应] AntProject:/root/.jenkins/jobs/Ant/workspace/build.xml
    [javac的] 2编译源文件/root/.jenkins/jobs/Ant/workspace/bin
    [javac的] /root/.jenkins/jobs/Ant/workspace/src/com/moi/test/junit/MaClasseTest.java:3:包org.junit不存在
    [javac的]进口静态org.junit.Assert *。
    [javac的] ^
    [javac的] /root/.jenkins/jobs/Ant/workspace/src/com/moi/test/junit/MaClasseTest.java:5:包org.junit不存在
    [javac的]进口org.junit.Test;
    [javac的] ^
    [javac的] /root/.jenkins/jobs/Ant/workspace/src/com/moi/test/junit/MaClasseTest.java:9:找不到符号
    [javac的]符号:类测试
    [javac的]地址:类com.moi.test.junit.MaClasseTest
    [javac的] @Test
    [javac的] ^
    [javac的] /root/.jenkins/jobs/Ant/workspace/src/com/moi/test/junit/MaClasseTest.java:12:找不到符号
    [javac的]符号:方法assertTrue(布尔)
    [javac的]地址:类com.moi.test.junit.MaClasseTest
    [javac的] assertTrue(MaClasse.additioner(2,2)== 4);
    [javac的] ^
    [javac的] 4个错误构建失败/root/.jenkins/jobs/Ant/workspace/build.xml:35:编译失败;详情请参见编译器错误输出。


解决方案

看来你忘了让现有的JUnit库在classparh

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.
解决方案

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

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

08-05 01:27