{"id":398,"date":"2013-04-07T16:22:58","date_gmt":"2013-04-07T15:22:58","guid":{"rendered":"http:\/\/qualilogy.com\/en\/?p=398"},"modified":"2013-04-07T16:59:08","modified_gmt":"2013-04-07T15:59:08","slug":"install-sonar-the-sonar-webap","status":"publish","type":"post","link":"http:\/\/qualilogy.com\/en\/install-sonar-the-sonar-webap\/","title":{"rendered":"Install Sonar &#8211; The Sonar webap"},"content":{"rendered":"<p><a href=\"http:\/\/vicken.deviantart.com\/\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-680\" alt=\"Installation de Sonar\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/04\/SonarInstall.jpg\" width=\"350\" height=\"233\" \/><\/a>I am a little late in writing this series of articles on installing and using Sonar: it was Semana Santa in Spain, a week of holidays and so I wanted to enjoy it for the first time this year. And as the next week has been short but intense, I could not catch up.<\/p>\n<p>Fortunately, we&#8217;re done with long articles on Oracle, and as the installation of Sonar is not very complicated &#8211; if you take the time to carefully observe every step &#8211; I hope to write posts shorter but more frequent.<!--more--><\/p>\n<p>If you get directly to this page without having looked at the previous posts, I encourage you to read them. In our environment, we chose to install a <a title=\"Install JDK6\" href=\"http:\/\/qualilogy.com\/en\/install-sonar-jdk\/\" target=\"_blank\">JDK (Java 6)<\/a>, <a title=\"Install Tomcat\" href=\"http:\/\/qualilogy.com\/en\/install-sonar-tomcat\/\" target=\"_blank\">Tomcat 7<\/a> and a <a title=\"Install Oracle 11\" href=\"http:\/\/qualilogy.com\/en\/install-sonar-oracle\/\" target=\"_blank\">Oracle 11 database<\/a>, There are a few other posts to run your Oracle but also create a user (schema) for Sonar.<\/p>\n<p>If you want to perform an upgrade of a Sonar existing version, not a new installation, you will find some indications on <a title=\"Upgrade Sonar\" href=\"http:\/\/qualilogy.com\/en\/sonar-upgrade\/\" target=\"_blank\">this page<\/a>.<\/p>\n<h2>Installing and configuring Sonar<\/h2>\n<p>The first step of this installation will be to download the latest version of Sonar from the download page <a title=\"Download Sonar\" href=\"http:\/\/www.sonarsource.org\/downloads\/\" target=\"_blank\">http:\/\/www.sonarsource.org\/downloads\/<\/a>.<\/p>\n<p>In our case, it will be a version 3.5.1. Obviously, you can install any newer version you may find.<\/p>\n<p>So for this new instalation, we will download the file &#8216;sonar-3.5.1.zip&#8217; and unzip it into a &#8216;sonar-3.5.1&#8217; directory. In my case, I installed all my software in a folder &#8216;C:\\Soft&#8217; with a subdirectory specific to each software. After unzipping the zip file, I now have a directory &#8216;C:\\Soft\\Sonar\\sonar-3.5.1&#8217;.<\/p>\n<p>In this folder, we look into the directory &#8216;..\\conf&#8217; for the file &#8216;sonar.properties&#8217; in order to edit it.<br \/>\nIn this file, a user &#8216;sonar\u00a1 is already defined with its password:<\/p>\n<p style=\"padding-left: 30px\"><strong>sonar.jdbc.username: sonar<\/strong><br \/>\n<strong> sonar.jdbc.password: sonar<\/strong><\/p>\n<p>This corresponds to the Oracle user that we did create in a previous post: <a title=\"Create an Oracle user\" href=\"http:\/\/qualilogy.com\/en\/install-sonar-oracle-user\/\" target=\"_blank\">Create an Oracle user<\/a>.<\/p>\n<p>We do not want to use the database supplied by default with Sonar, so we put the following lines in comments:<\/p>\n<p style=\"padding-left: 30px\"><strong> # Comment the following line to deactivate the default embedded database.<\/strong><br \/>\n<strong> <strong># <\/strong>sonar.jdbc.url: jdbc:h2:tcp:\/\/localhost:9092\/sonar<\/strong><\/p>\n<p>And we search for the section to set our Oracle connection:<\/p>\n<p style=\"padding-left: 30px\"><strong>sonar.jdbc.url: jdbc:oracle:thin:@localhost:1521\/JPORA11<\/strong><\/p>\n<p>My Oracle database is called JPORA11 and is installed on port 1521 (default port for Oracle) on my own machine &#8216;localhost&#8217;. These are the only parameters to be specified according to your own environment.<\/p>\n<p>And that&#8217;s it.<\/p>\n<p>Well, we still have to find the Oracle JDBC driver (thin client) &#8216;ojdbc6.jar&#8217; and copy it into the Sonar directory &#8216;\\extensions\\jdbc-driver\\oracle&#8217;. You can find this file in the directory\u2018\\jdbc\\lib\u2019 of your Oracle environment (C:\\ORA11\\11.2.0\\dbhome_1\\jdbc\\lib in mine).<\/p>\n<p>You can also go to the <a title=\"Sonar Supported Platforms\" href=\"http:\/\/docs.codehaus.org\/display\/SONAR\/Requirements#Requirements-SupportedPlatforms\" target=\"_blank\">Sonar requirements page<\/a>, in the &#8216;Supported Platforms&#8217; section and locate the Oracle 11.2.x link. This takes you to the Oracle site from where you can download this driver. You will need to connect with your Oracle account.<\/p>\n<h2>Install the Sonar webap<\/h2>\n<p>Last step: generate the file &#8216;sonar.war&#8217; that we will use to deploy Sonar under Tomcat. Everyone knows what is a .war file: a compressed file that will allow us to install the Sonar web application &#8211; the Sonar dashboard.<\/p>\n<p>Previously, you may want to download (from the <a title=\"Sonar Plugin Library\" href=\"http:\/\/docs.codehaus.org\/display\/SONAR\/Plugin+Library\" target=\"_blank\">Plugin Library<\/a> page) the Sonar plugins you want to use. Copy them into the Sonar directory &#8216;\\extensions\\plugins&#8217;. It is not absolutely necessary, you can do it later. I will begin to use Sonar without any of these plugins.<\/p>\n<p>To build the file &#8216;sonar.war&#8217;, simply run the file &#8216;build-war.bat&#8217; from the directory &#8216;\\war&#8217;. The .war will be generated in the same directory.<\/p>\n<p>We can now deploy it. I just copy it into the directory \u2018C:\\Program Files\\Apache Software Foundation\\Tomcat 7.0\\webapps\u2019, then start the Tomcat service in order to create a new folder \u2013 a new webapp \u2013 \u2018\\sonar\u2019.<\/p>\n<p>The first time you install Sonar, it will take a few minutes to create the database schema in the Oracle user previously defined. Give it some time to accomplish this task before starting the Sonar webapp.<\/p>\n<p>It is now available from the URL corresponding to the directory of the Sonar webapp: \u2018http:\/\/localhost:8888\/sonar\/\u2019 in my environment.<\/p>\n<p><a href=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/04\/SonarFirstStart.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-690\" alt=\"Home page de Sonar apr\u00e8s installation\" src=\"http:\/\/qualilogy.com\/fr\/wp-content\/uploads\/sites\/2\/2013\/04\/SonarFirstStart.jpg\" width=\"681\" height=\"286\" \/><\/a><\/p>\n<p>Et voil\u00e0. Before detailing the Sonar interface, we&#8217;ll wait for a first analysis, so that we can view data in the dashboard.<\/p>\n<p>And to do that, we will install the Sonar-Runner. In the &#8211; very &#8211; next post.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am a little late in writing this series of articles on installing and using Sonar: it was Semana Santa in Spain, a week of holidays and so I wanted to enjoy it for the first time this year. And as the next week has been short but intense, I could not catch up. Fortunately, [&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-398","post","type-post","status-publish","format-standard","hentry","category-sonar-installation"],"_links":{"self":[{"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/posts\/398"}],"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=398"}],"version-history":[{"count":12,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/posts\/398\/revisions"}],"predecessor-version":[{"id":411,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/posts\/398\/revisions\/411"}],"wp:attachment":[{"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/media?parent=398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/categories?post=398"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/qualilogy.com\/en\/wp-json\/wp\/v2\/tags?post=398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}