I am using Jenkins 1.450 for CI, my source code is in a git repo, and I am using maven as build environment.
My problem: I cannot get Jenkins to generate test results.
Details:
1. If I create a ‘freestyle’ job in Jenkins, it executes the build successfully. But, if I select the ‘Publish JUnit test result report’ option, Jenkins cannot find the test report files. I can see them in target/surefire-reports/ if I do ‘mvn install’ myself, but Jenkins somehow doesn’t build in the workplace… after a Jenkins build, I don’t see this target directory created.
2. If I create ‘Maven 2/3’ job, and give it path to my Maven installation, Jenkins simply does not find it – it says: <path>/Maven_3.0.4 doesn't have a 'lib' subdirectory - thus cannot be a valid maven installation!
The error doesn’t change even after giving read-write-execute permissions to all users for this directory.
What is it that I am doing wrong here? Do I need to have the <reporting> tag in my pom files? Where can I find documentation/troubleshooting info for all this?
Thanks!
Maven 2/3 project satisfies our test-reports requirements. Once I saw that, I went ahead and figured out the problems in building the same.
I followed these steps to install Maven: http://lukieb.wordpress.com/2011/02/15/installing-maven-3-on-ubuntu-10-04-lts-server/, and then made sure that path to maven install was set properly in Jenkins.
As we are building Android applications, the next problem was ANDROID_HOME variable – Jenkins could not find Android SDK location without it. Doing a
exportdidn’t help; it never ‘stuck’. Moreover, thePATHseen by Jenkins and byecho $PATHdid not match. The answer was modifying/etc/profile, and addingexport ANDROID_HOMEand thenexport PATH=$ANDROID_HOME:$PATHthere. (I got this from another Stackoverflow question.)After all this, now my CI setup is working.
[I am accepting this answer, please let me know if you need further info…]