{"id":771,"date":"2013-12-08T09:40:59","date_gmt":"2013-12-08T08:40:59","guid":{"rendered":"http:\/\/qualilogy.com\/en\/?p=771"},"modified":"2013-12-08T16:25:54","modified_gmt":"2013-12-08T15:25:54","slug":"upgrade-sonarqube-runner-jenkins","status":"publish","type":"post","link":"http:\/\/qualilogy.com\/en\/upgrade-sonarqube-runner-jenkins\/","title":{"rendered":"Upgrade SonarQube-Runner and Jenkins"},"content":{"rendered":"<p><a href=\"http:\/\/500px.com\/Vicken\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-1378\" alt=\"JenkinsUpgrade\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/12\/JenkinsUpgrade.jpg\" width=\"350\" height=\"247\" \/><\/a>I updated my version of SonarQube int the post <a href=\"http:\/\/qualilogy.com\/en\/sonarqube-upgrade-4-0\/\" target=\"_blank\">SonarQube Upgrade 4.0<\/a>,\u00a0which was an opportunity to document some errors encountered.<\/p>\n<p>I also wanted to updater other components such as the SonarQube-Runner and Jenkins and Mr. Jenkins caused me some problems.<\/p>\n<p>So this post will allow us to see an upgrade of the SonarQube-Runner and Jenkins, as well as solve (or avoid) the errors encountered. <!--more--><\/p>\n<h2>Jenkins Upgrade<\/h2>\n<p>After completing the upgrade of SonarQube in 4.0, I went into the portal Jenkins to run an analysis. I noticed at that time that there was a new version of Jenkins, so I decided to take the opportunity to also update it.<\/p>\n<p>But this time, instead of <a href=\"http:\/\/qualilogy.com\/fr\/migrer-jenkins-tomcat-service-windows\/\" target=\"_blank\">installing Jenkins as a Windows service<\/a>, as we have seen there a few times ago, I thought it would be an opportunity to install Jenkins with a Windows install, I mean, from an installation executable.<\/p>\n<p>So I went on <a title=\"La page d'accueil de Jenkins\" href=\"http:\/\/jenkins-ci.org\/\" target=\"_blank\">the Jenkins site<\/a> in order to download the Windos native <a href=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/12\/DownloadJenkinsWindows.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-1385\" alt=\"DownloadJenkinsWindows\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/12\/DownloadJenkinsWindows.jpg\" width=\"165\" height=\"62\" \/><\/a>package, a zipped file &#8216;jenkins-1.541.zip&#8217;.<\/p>\n<p><a href=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/12\/InstallJenkinsSetup.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-1387\" alt=\"InstallJenkinsSetup\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/12\/InstallJenkinsSetup.jpg\" width=\"165\" height=\"75\" \/><\/a>After we unziip it, we now have a &#8216;setup.exe&#8217; file and a &#8216;jenkins-1.541.msi&#8217; install file.<\/p>\n<p>I will check that the current Jenkins service is stopped. And I will launch the &#8216;setup.exe&#8217;. The install &#8211; in fact the update of the Windows service Jenkins &#8211; goes trough different steps: &#8216;Installing&#8217;, &#8216;Validating install&#8217;, &#8216;Starting service&#8217;, &#8230; I&#8217;ll spare you the details.<\/p>\n<p>I know that the service has been updated for the good reason that &#8230; it does not start. Well, I got the same error that we met during our first <a href=\"http:\/\/qualilogy.com\/fr\/migrer-jenkins-tomcat-service-windows\/\" target=\"_blank\">install of Jenkins as a Windows service<\/a>, which is that I need to change the Windows user in order to start the service correctly.<\/p>\n<p>Once done , the Jenkins service starts without a problem, but against impossible to display the portal Jenkins at its usual url <strong>http:\/\/localhost:8080\/<\/strong>. I see a strong activity of my computer from the Windows Task List, a Java process that takes a lot of CPU, continuously.<\/p>\n<p>I waited patiently, I stopped \/ started Jenkins\u00a0several times, and even rebooted my computer, but nothing happens. In fact, navigating through the various Jenkins logs, I discovered that a library was missing (a .jar file) so there was no possible way to get a correct functioning of the Jenkins webapp. Although the Se\u00f1or Jenkins tried to launch continuously in an unsuccessful loop and without any message of explanation of what it was doing.<\/p>\n<p>So I ended up uninstalling the Jenkins application using the same procedure as in the post about <a href=\"http:\/\/qualilogy.com\/fr\/migrer-jenkins-tomcat-service-windows\/\" target=\"_blank\">installing Jenkins as a Windows service<\/a>, from a war file. Thus, I will not detail again this installation, but simply list the main steps:<\/p>\n<ol>\n<li>Download the &#8216;jenkins.war&#8217; file from <a title=\"La page d'accueil de Jenkins\" href=\"http:\/\/jenkins-ci.org\/\" target=\"_blank\">the Jenkins site.<\/a><\/li>\n<li>Launch Jenkins from a DOS windows with the command <strong>java -jar jenkins.war<\/strong>.<\/li>\n<li>In the Jenkins portal that opens at the url <strong>http:\/\/localhost:8080\/<\/strong>, goes to the menu &#8216;Manage Jenkins&#8217;, then &#8216;Install as Windows service&#8217;.<\/li>\n<li>Follow the procedure of installation and once Jenkins is installed (or updated) as a Windows service, I have to modify the Windows user by default, with one with enough rights to start Jenkins. This step is probably specific to my laptop, it should be optional for a server installation of Jenkins.<\/li>\n<li>Then I change the configuration of Jenkins in the file \u2018<strong>jenkins.xml<\/strong>\u2018) to make it point to my current repository, and recover all existing analysis jobs.<\/li>\n<\/ol>\n<p>And then, finally, I can start Jenkins.<\/p>\n<h2>SonarQube is missing<\/h2>\n<p>Well, maybe I can start Jenkins but no SonarQube analysis job is running. I launch it and nothing happens.Not even an error message. I go to check the installed plugins and the SonarQube plugin is present in my current configuration. However, when I go to the configuration page of Jenkins (menu &#8216;Manage Jenkins&#8217;), the part corresponding to the <a href=\"http:\/\/qualilogy.com\/en\/sonarqube-windows-jenkins-tomcat\/\" target=\"_blank\">settings of SonarQube<\/a> is not there.<\/p>\n<p>I spent a lot of time and it took me several failed attempts (including a re-install of the plugin SonarQube which resulted in the loss of the configurations of my analysis) before discovering the error. I do not know how it could happen, if it comes from the unsuccessful installation of Jenkins with a native Windows package, or simply a bad manipulation on my part, but the plugin &#8216;Maven Integration&#8217; was disabled and this is what did cause that SonarQube became invisible. As I am not a Maveniste, it may well be that I disactivated this plugin without remembering it.<\/p>\n<p><a href=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/12\/JenkinsMavenIntegrationPlugin.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1394\" alt=\"JenkinsMavenIntegrationPlugin\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/12\/JenkinsMavenIntegrationPlugin.jpg\" width=\"716\" height=\"52\" \/><\/a><\/p>\n<p>I did reactivate it and my SonarQube configuration did come back at it was originally. (see the posts about <a href=\"http:\/\/qualilogy.com\/en\/sonarqube-windows-jenkins-tomcat\/\" target=\"_blank\">installing SonarQube as a Windows service<\/a>, and <a href=\"http:\/\/qualilogy.com\/en\/install-sonarqube-the-sonarqub-jenkins-plugin\/\" target=\"_blank\">installing the SonarQube plugins for Jenkins<\/a>).<\/p>\n<h2>SonarQube-Runner upgrade<\/h2>\n<p>The update SonarQube Runner has not been a problem. So again, I will resume the main steps (as seen in the post about the\u00a0<a href=\"http:\/\/qualilogy.com\/en\/install-sonarqube-the-sonarqub-jenkins-plugin\/\" target=\"_blank\">installation of SonarQube-Runner<\/a>):<\/p>\n<ol>\n<li>Download the SonarQube Runner installation file from the page <a title=\"Installing and configuing the Sonar Runner\" href=\"http:\/\/docs.codehaus.org\/display\/SONAR\/Installing+and+Configuring+SonarQube+Runner\" target=\"_blank\">Installing and Configuring SonarQube Runner<\/a>, in the 2.3 version in my case (at the date of this post).<\/li>\n<li>Unzip this file into a directory \u2018sonar-runner-2.3\u2019.<\/li>\n<li>Modify the configuration file &#8216;sonar-runner.properties&#8217; in order to indicate the localisation of SonarQube and of our Oracle database.<\/li>\n<\/ol>\n<p style=\"text-align: center\"><a href=\"http:\/\/500px.com\/Vicken\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" alt=\"\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/09\/SonarQubeSonarUrlOk.jpg\" width=\"377\" height=\"60\" \/><\/a><\/p>\n<p><a href=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/12\/JenkinsSonarRunnerInstallation.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-1395\" alt=\"JenkinsSonarRunnerInstallation\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/12\/JenkinsSonarRunnerInstallation.jpg\" width=\"180\" height=\"62\" \/><\/a>In Jenkins, we go back to the configuration page (menu &#8216;Manage Jenkins&#8217;) and opten the section dedicated to the SonarQube-Runner configuration. Just specify the location of this new version and that&#8217;s it.<\/p>\n<p><a href=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/12\/JenkinsSonarRunnerInstallation2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1396\" alt=\"JenkinsSonarRunnerInstallation2\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/12\/JenkinsSonarRunnerInstallation2.jpg\" width=\"569\" height=\"138\" \/><\/a><\/p>\n<p>Et voil\u00e0 ! I can resume my analysis, all with a full up-to-date environment with SonarQube the SonarQube Runner and Jenkins.<\/p>\n<p>Last tip: if you lost the configuration of a job analysis in Jenkins, you can retrieve it from a backup of your repository.<\/p>\n<p><a href=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/12\/JenkinsJobConfigXML.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-1404\" alt=\"JenkinsJobConfigXML\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/12\/JenkinsJobConfigXML.jpg\" width=\"412\" height=\"248\" \/><\/a>The <span id=\"result_box\" lang=\"en\"><span class=\"hps\">analysis<\/span> <span class=\"hps\">are located<\/span> <span class=\"hps atn\">in the &#8216;<\/span><span>Jobs&#8217; folder<\/span><span>,<\/span> <span class=\"hps\">with<\/span> <span class=\"hps\">a subdirectory<\/span> <span class=\"hps\">for each analysis.<\/span> <span class=\"hps\">Where you will find<\/span> <span class=\"hps\">a <\/span><\/span><strong>config.xml<\/strong> file with the configuration of the job, as for example the different SonarQube properties I indicate as parameters of the analysis.<\/p>\n<h2>Conclusion<\/h2>\n<p><span id=\"result_box\" lang=\"en\"><span class=\"hps\">I must say that<\/span> <span class=\"hps\">I did not try<\/span><span class=\"hps\"> to<\/span> <span class=\"hps\">investigate furthermore the origin of the errors I have encountered?<\/span><span>.<\/span> <span class=\"hps\">But<\/span> <span class=\"hps\">in conclusion, we<\/span> <span class=\"hps\">can say that:<\/span><\/span><\/p>\n<p><span class=\"hps\">Installing the<\/span> <span class=\"hps\">Windows<\/span> <span class=\"hps\">Jenkins<\/span> <span class=\"hps\">service from<\/span> <span class=\"hps\">a file<\/span><span>. War<\/span> <span class=\"hps\">seems more<\/span> <span class=\"hps\">stable, although<\/span> <span class=\"hps\">less<\/span> <span class=\"hps\">natural<\/span> <span class=\"hps\">than from a<\/span> <span class=\"hps\">setup executable<\/span> <span class=\"hps\">(setup.exe<\/span> <span class=\"hps\">deviation).<\/span><br \/>\n<span class=\"hps\">If the<\/span> <span class=\"hps\">configuration<\/span> <span class=\"hps\">SonarQube<\/span> <span class=\"hps\">disappeared from<\/span> <span class=\"hps\">Jenkins<\/span> <span class=\"hps\">configuration page<\/span><span>, verify<\/span> <span class=\"hps\">that you have<\/span> <span class=\"hps\">the<\/span> <span class=\"hps atn\">plugin &#8216;<\/span><span>Maven<\/span> <span class=\"hps\">Integration<\/span><span>&#8216;<\/span> <span class=\"hps\">installed.<\/span> <span class=\"hps\">Do not<\/span> <span class=\"hps\">ask me why,<\/span> <span class=\"hps\">I do not use<\/span> <span class=\"hps\">Maven<\/span><span>.<\/span><\/p>\n<ul>\n<li>Installing Jenkins as a Windows service from a .war file seems more stable, although less natural than from a setup file.<\/li>\n<li>If the SonarQube configuration disappeared from the Jenkins configuration page, verify that you have the plugin &#8216;Maven Integration&#8217; installed. Do not ask me why, I do not use Maven.<\/li>\n<\/ul>\n<p><span id=\"result_box\" lang=\"en\"><span class=\"hps\">Too bad<\/span> that <span class=\"hps\">no error<\/span> <span class=\"hps\">message<\/span> <span class=\"hps\">tells us<\/span> <span class=\"hps\">that it is not<\/span> <span class=\"hps\">possible to perform<\/span> <span class=\"hps\">an analysis,<\/span> <span class=\"hps\">as<\/span> <span class=\"hps\">Jenkins<\/span> <span class=\"hps\">does not know<\/span> how to <span class=\"hps\">locate<\/span> <span class=\"hps\">SonarQube<\/span><span>.<\/span> <span class=\"hps\">But at least<\/span> <span class=\"hps\">now, if<\/span> <span class=\"hps\">this error occurs,<\/span> <span class=\"hps\">we know<\/span> <span class=\"hps\">how to correct it<\/span><span>. <\/span><\/span><\/p>\n<p><span id=\"result_box\" lang=\"en\"><span class=\"hps\">And finally, we<\/span> <span class=\"hps\">have also seen<\/span> <span class=\"hps\">how to retrieve the<\/span> <span class=\"hps\">Jenkins<\/span> <span class=\"hps\">configuration<\/span> <span class=\"hps\">of our<\/span> <span class=\"hps\">analysis<\/span> <span class=\"hps\">jobs<\/span><span>.<\/span> <span class=\"hps\">And<\/span> <span class=\"hps\">our<\/span> <span class=\"hps\">environment is completely<\/span> <span class=\"hps\">up-to-tade<\/span><span>.<\/span> <span class=\"hps\">Well, that was worth<\/span> <span class=\"hps\">a<\/span> <span class=\"hps\">post<\/span><span>!<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I updated my version of SonarQube int the post SonarQube Upgrade 4.0,\u00a0which was an opportunity to document some errors encountered. I also wanted to updater other components such as the SonarQube-Runner and Jenkins and Mr. Jenkins caused me some problems. So this post will allow us to see an upgrade of the SonarQube-Runner and Jenkins, [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-771","post","type-post","status-publish","format-standard","hentry","category-sonar-installation"],"_links":{"self":[{"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/posts\/771"}],"collection":[{"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/comments?post=771"}],"version-history":[{"count":12,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/posts\/771\/revisions"}],"predecessor-version":[{"id":774,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/posts\/771\/revisions\/774"}],"wp:attachment":[{"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/media?parent=771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/categories?post=771"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/tags?post=771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}