Posts

Showing posts with the label jenkins

Groovy : Constructor call must be the first statement in a constructor

Image
Clash Royale CLAN TAG #URR8PPP Groovy : Constructor call must be the first statement in a constructor New to Groovy. Using scripts as part of Jenkins pipeline. Editing in Sublime with only a linter. Receiving this error: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: file:/var/jenkins_home/jobs/{repo}/branches/master/builds/9/libs/{jenkins-library-name}/src/{srcPath}/Pom_EX.groovy: 12: Constructor call must be the first statement in a constructor. at line: 12 column: 11. 1 Answer 1 Really beat myself up here for taking so long to see it. I didn't see it, since I've been working in Java for a few years now - and the IDE points out this type of mistake. Name of the constructor didn't match the class.... I reproduced the problem with a dummy class. Running DUMMY d = new DUMMY('blah') produced : DUMMY d = new DUMMY('blah') 1 compilation...

Jenkins Workspace not visible on docker slaves

Image
Clash Royale CLAN TAG #URR8PPP Jenkins Workspace not visible on docker slaves I am having a Master slave setup in jenkins, where all of my slave machines are docker slaves. I am using Yet another docker plugin to configure these slaves. All my jobs are passing successfully on the slave nodes, but I cannot view the workspace from the jenkins UI. Is this because the container gets destroyed after the build is getting executed successfully? If yes, then what is a work around to view the workspace. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Jenkins, specifying JAVA_HOME

Image
Clash Royale CLAN TAG #URR8PPP Jenkins, specifying JAVA_HOME I installed openjdk-6-jdk on my ubuntu box using apt-get. In system info jenkins is telling me Java.Home is /usr/lib/jvm/java-6-openjdk/jre /usr/lib/jvm/java-6-openjdk/jre However when I specify that directory as JAVA_HOME in Jenkins : "configure system", it returns error message saying that directory does not look like a jdk directory. JAVA_HOME it is also failing to pick up my maven install. Am I missing something obvious ? 12 Answers 12 Your JAVA_HOME variable must be setted to /usr/lib/jvm/java-6-openjdk and it must be available for the user that starts Jenkins. From Kyle Strand comment: As of April 2015 (I think), Jenkins requires Java7. Also note that the java binary path (JAVA) must be set to the correct version if the system default is still Java 6. Finally, for anyone wondering where these variables are set, it's i...

how to specify the pom.xml path in jenkins pipeline script

Image
Clash Royale CLAN TAG #URR8PPP how to specify the pom.xml path in jenkins pipeline script my maven project looks like below working dir Jenkins error this is how my script looks like node { stage ('Build') { git url: 'https://github.com/rakshitha2/test_proj.git' def mvnHome = tool 'M3' bat "${mvnHome}binmvn -B install" } } I have to go inside parent directory and execute maven command in Jenkins pipeline script. I tried specifying POM path in MVN command its giving me an error saying "path is unexpected at this time". but the same is working in my local. I'm new to Jenkins and groovy. kindly help me with this. add you pom.xml to question and the log of the error so people can understand the issue – user7294900 Jun 15 '17 at 7:21 Hi, issue is not with the pom, ...

How can I automatically svn tag build output files with Jenkins?

Image
How can I automatically svn tag build output files with Jenkins? I'm automating the following manual process with Jenkins: Steps 1-3 are working, but I need some help with tagging in step 4. There are some possible solutions that I've excluded: Tools seem to be available for Git. Is there another way to do it for svn that I haven't thought of? 1 Answer 1 What about svn commandline? Your could try to create a tag using shell : svn copy http://svn/mywebsite/trunk http://svn/mywebsite/tags/2.2.1 -m "Release 2.2.1 - added new feature" Source: http://svnbook.red-bean.com/en/1.6/svn.branchmerge.tags.html If it works, your step 4 could be a build step called : Execute Shell : Just put your shell script in the text-area called command . You could use variables for your url, tag number, etc Finally, you could create a jenkins plugin called svn command line tool to make life easier. I...