Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running jenkins gives "package org.junit does not exist"

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.
like image 807
Manoel Avatar asked Oct 11 '22 18:10

Manoel


1 Answers

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

like image 56
jmj Avatar answered Oct 14 '22 03:10

jmj