SonarQube Update 4.2

De EjnTricks
Révision de 5 avril 2018 à 10:52 par Etienne (discussion | contributions)

(diff) ← Version précédente | Voir la version courante (diff) | Version suivante → (diff)

Hand-icon.png Votre avis

Nobody voted on this yet

 You need to enable JavaScript to vote


System-Install-icon.png Download-icon.png Téléchargement et installation

#sudo wget -P /tmp https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-4.2.zip
#sudo unzip -d /tmp /tmp/sonarqube-4.2.zip


Icon-Configuration-Settings.png Déploiement

La mise en place de l'application s'inspire de ce qui était préalablement réalisé par script ANT.

Il faut dans un premier temps copier l'application sous le répertoire webapps de Tomcat.

#sudo service tomcat7 stop
#sudo rm -rf /var/lib/tomcat7/webapps/sonar*
#sudo mv /tmp/sonarqube-4.2/web /var/lib/tomcat7/webapps/sonar
#sudo chown -R tomcat7:tomcat7 /var/lib/tomcat7/webapps/sonar


Icon-database.png Driver base de données

Plusieurs drivers sont fournis avec la distribution. Dans les précédentes versions, tous les drivers étaient copiés dans le répertoire WEB-INF/lib de l'application. Mais il suffit de choisir le driver en fonction de la base de données utilisée. Dans le cadre de cet article, MySql est utilisé.

#sudo cp /tmp/sonarqube-4.2/extensions/jdbc-driver/mysql/*.jar /var/lib/tomcat7/webapps/sonar/WEB-INF/lib/
#sudo chown tomcat7:tomcat7 /var/lib/tomcat7/webapps/sonar/WEB-INF/lib/*.jar

A noter, le driver doit être disponible dans le répertoire WEB-INF et dans l'arborescence extensions/jdbc-driver dans l'emplacement défini par SONAR_HOME.


Update icon.png Plugin-icon.png Plugins

Des plugins principaux et complémentaires sont disponibles dans la distribution. Les premiers doivent être disponibles le répertoire lib/core-plugins. Les seconds doivent être déposés dans extensions/downloads, et seront installés lors du démarrage.

#sudo rm -rf /var/opt/sonar/extensions/jdbc-driver
#sudo rm -f /var/opt/sonar/lib/core-plugins/*.jar
#sudo cp -p -R /tmp/sonarqube-4.2/extensions/jdbc-driver /var/opt/sonar/extensions/jdbc-driver
#sudo cp -p /tmp/sonarqube-4.2/lib/bundled-plugins/*.jar /var/opt/sonar/extensions/downloads/
#sudo cp -p /tmp/sonarqube-4.2/lib/core-plugins/*.jar /var/opt/sonar/lib/core-plugins/
#sudo chown -R tomcat7:tomcat7 /var/opt/sonar/extensions/jdbc-driver
#sudo chown tomcat7:tomcat7 /var/opt/sonar/extensions/downloads/*.jar
#sudo chown tomcat7:tomcat7 /var/opt/sonar/lib/core-plugins/*.jar


Sur la machine, les plugins suivants doivent être mis à jour:


Le plugin Taglist est marqué comme Deprecated à partir de la version 4.2. Il suffit de placer le jar dans le répertoire /var/opt/sonar/extensions/deprecated, et il sera supprimé lors du démarrage.

#sudo mv /var/opt/sonar/extensions/plugins/sonar-taglist-plugin-1.0.jar /var/opt/sonar/extensions/deprecated


Bug-icon.png Erreurs

Certains plugins ne sont plus compatibles. La documentation mentionne un matrice de compatibilités sur laqelle il est nécessaire de s'appuyer afin d'identifier les versions utilisables.

En fonction des plugins installés, une erreur peut se produire. Dans le cadre de cette installation, le plugin Checkstyle était installé en version 1.5, et le plugin standard Java en version 2.1, entraînant une erreur lors du démarrage. Le message suivant est affiché dans la log sonar.log.

2015.08.27 00:12:31 ERROR [o.s.s.p.PlatformLifecycleListener]  Fail to start server
org.sonar.updatecenter.common.exception.IncompatiblePluginVersionException: The plugins 'checkstyle' and 'java' must have exactly the same version as they belong to the same group.
        at org.sonar.updatecenter.common.PluginReferential.getParentRelease(PluginReferential.java:132) ~[sonar-update-center-common-1.8.jar:na]
        at org.sonar.updatecenter.common.PluginReferential.setParent(PluginReferential.java:120) ~[sonar-update-center-common-1.8.jar:na]
        at org.sonar.updatecenter.common.PluginReferentialManifestConverter.fromPluginManifests(PluginReferentialManifestConverter.java:54) ~[sonar-update-center-common-1.8.jar:na]
        at org.sonar.server.plugins.PluginReferentialMetadataConverter.getInstalledPluginReferential(PluginReferentialMetadataConverter.java:40) ~
[PluginReferentialMetadataConverter.class:na]
        at org.sonar.server.plugins.InstalledPluginReferentialFactory.init(InstalledPluginReferentialFactory.java:48) ~[InstalledPluginReferentialFactory.class:na]
        at org.sonar.server.plugins.InstalledPluginReferentialFactory.start(InstalledPluginReferentialFactory.java:37) ~[InstalledPluginReferentialFactory.class:na]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_72]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_72]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_72]
        at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_72]

Celui-ci est donc mis à jour avec une version compatible.

#sudo wget -P /var/opt/sonar/extensions/downloads http://downloads.sonarsource.com/plugins/org/codehaus/sonar-plugins/java/sonar-checkstyle-plugin/2.1.1/sonar-checkstyle-plugin-2.1.1.jar
#sudo chown tomcat7:tomcat7 /var/opt/sonar/extensions/downloads/sonar-checkstyle-plugin-2.1.1.jar


le plugin Pmd était installé en version 1.5, et le plugin standard Java en version 2.1, entraînant une erreur lors du démarrage. Le message suivant est affiché dans la log sonar.log.

2015.08.27 00:31:29 ERROR [o.s.s.p.PlatformLifecycleListener]  Fail to start server
org.sonar.updatecenter.common.exception.IncompatiblePluginVersionException: The plugins 'pmd' and 'java' must have exactly the same version as they belong to the same group.
        at org.sonar.updatecenter.common.PluginReferential.getParentRelease(PluginReferential.java:132) ~[sonar-update-center-common-1.8.jar:na]
        at org.sonar.updatecenter.common.PluginReferential.setParent(PluginReferential.java:120) ~[sonar-update-center-common-1.8.jar:na]
        at org.sonar.updatecenter.common.PluginReferentialManifestConverter.fromPluginManifests(PluginReferentialManifestConverter.java:54) ~[sonar-update-center-common-1.8.jar:na]
        at org.sonar.server.plugins.PluginReferentialMetadataConverter.getInstalledPluginReferential(PluginReferentialMetadataConverter.java:40) ~
[PluginReferentialMetadataConverter.class:na]
        at org.sonar.server.plugins.InstalledPluginReferentialFactory.init(InstalledPluginReferentialFactory.java:48) ~[InstalledPluginReferentialFactory.class:na]
        at org.sonar.server.plugins.InstalledPluginReferentialFactory.start(InstalledPluginReferentialFactory.java:37) ~[InstalledPluginReferentialFactory.class:na]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_72]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_72]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_72]
        at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_72]

Celui-ci est donc mis à jour avec une version compatible.

#sudo wget -P /var/opt/sonar/extensions/downloads http://downloads.sonarsource.com/plugins/org/codehaus/sonar-plugins/java/sonar-pmd-plugin/2.2/sonar-pmd-plugin-2.2.jar
#sudo chown tomcat7:tomcat7 /var/opt/sonar/extensions/downloads/sonar-pmd-plugin-2.2.jar


le plugin Findbugs était installé en version 2.1, et le plugin standard Java est mis à jour avec la version 2.5.1, entraînant une erreur lors du démarrage. Le message suivant est affiché dans la log sonar.log.

2015.08.27 09:51:03 ERROR [o.s.s.p.PlatformLifecycleListener]  Fail to start server
org.sonar.updatecenter.common.exception.IncompatiblePluginVersionException: The plugins 'findbugs' and 'java' must have exactly the same version as they belong to the same group.
        at org.sonar.updatecenter.common.PluginReferential.getParentRelease(PluginReferential.java:132) ~[sonar-update-center-common-1.8.jar:na]
        at org.sonar.updatecenter.common.PluginReferential.setParent(PluginReferential.java:120) ~[sonar-update-center-common-1.8.jar:na]
        at org.sonar.updatecenter.common.PluginReferentialManifestConverter.fromPluginManifests(PluginReferentialManifestConverter.java:54) ~[sonar-update-center-common-1.8.jar:na]
        at org.sonar.server.plugins.PluginReferentialMetadataConverter.getInstalledPluginReferential(PluginReferentialMetadataConverter.java:40) ~
[PluginReferentialMetadataConverter.class:na]
        at org.sonar.server.plugins.InstalledPluginReferentialFactory.init(InstalledPluginReferentialFactory.java:48) ~[InstalledPluginReferentialFactory.class:na]
        at org.sonar.server.plugins.InstalledPluginReferentialFactory.start(InstalledPluginReferentialFactory.java:37) ~[InstalledPluginReferentialFactory.class:na]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_72]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_72]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_72]
        at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_72]

Celui-ci est donc mis à jour avec une version compatible.

#sudo wget -P /var/opt/sonar/extensions/downloads http://downloads.sonarsource.com/plugins/org/codehaus/sonar-plugins/java/sonar-findbugs-plugin/3.1/sonar-findbugs-plugin-3.1.jar
#sudo chown tomcat7:tomcat7 /var/opt/sonar/extensions/downloads/sonar-findbugs-plugin-3.1.jar


le plugin JaCoCo était installé en version 2.1, et le plugin standard Java est mis à jour avec la version 2.5.1, entraînant une erreur lors du démarrage. Le message suivant est affiché dans la log sonar.log.

2015.08.27 10:01:26 ERROR [o.s.s.p.PlatformLifecycleListener]  Fail to start server
org.sonar.updatecenter.common.exception.IncompatiblePluginVersionException: The plugins 'jacoco' and 'java' must have exactly the same version as they belong to the same group.
        at org.sonar.updatecenter.common.PluginReferential.getParentRelease(PluginReferential.java:132) ~[sonar-update-center-common-1.8.jar:na]
        at org.sonar.updatecenter.common.PluginReferential.setParent(PluginReferential.java:120) ~[sonar-update-center-common-1.8.jar:na]
        at org.sonar.updatecenter.common.PluginReferentialManifestConverter.fromPluginManifests(PluginReferentialManifestConverter.java:54) ~[sonar-update-center-common-1.8.jar:na]
        at org.sonar.server.plugins.PluginReferentialMetadataConverter.getInstalledPluginReferential(PluginReferentialMetadataConverter.java:40) ~
[PluginReferentialMetadataConverter.class:na]
        at org.sonar.server.plugins.InstalledPluginReferentialFactory.init(InstalledPluginReferentialFactory.java:48) ~[InstalledPluginReferentialFactory.class:na]
        at org.sonar.server.plugins.InstalledPluginReferentialFactory.start(InstalledPluginReferentialFactory.java:37) ~[InstalledPluginReferentialFactory.class:na]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_72]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_72]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_72]
        at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_72]

Le plugin JaCoCo ayant été intégré dans le plugin Java, la précédente version est placée dans le répertoire deprecated, entraînant sa suppression lors du prochain démarrage.

#sudo mv /var/opt/sonar/extensions/plugins/sonar-jacoco-plugin-2.1.jar /var/opt/sonar/extensions/deprecated


le plugin Surefire était installé en version 2.1, et le plugin standard Java est mis à jour avec la version 2.5.1, entraînant une erreur lors du démarrage. Le message suivant est affiché dans la log sonar.log.

2015.08.27 10:22:51 ERROR [o.s.s.p.PlatformLifecycleListener]  Fail to start server
org.sonar.updatecenter.common.exception.IncompatiblePluginVersionException: The plugins 'surefire' and 'java' must have exactly the same version as they belong to the same group.
        at org.sonar.updatecenter.common.PluginReferential.getParentRelease(PluginReferential.java:132) ~[sonar-update-center-common-1.8.jar:na]
        at org.sonar.updatecenter.common.PluginReferential.setParent(PluginReferential.java:120) ~[sonar-update-center-common-1.8.jar:na]
        at org.sonar.updatecenter.common.PluginReferentialManifestConverter.fromPluginManifests(PluginReferentialManifestConverter.java:54) ~[sonar-update-center-common-1.8.jar:na]
        at org.sonar.server.plugins.PluginReferentialMetadataConverter.getInstalledPluginReferential(PluginReferentialMetadataConverter.java:40) ~
[PluginReferentialMetadataConverter.class:na]
        at org.sonar.server.plugins.InstalledPluginReferentialFactory.init(InstalledPluginReferentialFactory.java:48) ~[InstalledPluginReferentialFactory.class:na]
        at org.sonar.server.plugins.InstalledPluginReferentialFactory.start(InstalledPluginReferentialFactory.java:37) ~[InstalledPluginReferentialFactory.class:na]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_72]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_72]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_72]
        at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_72]

Le plugin Surefire ayant été intégré dans le plugin Java, la précédente version est placée dans le répertoire deprecated, entraînant sa suppression lors du prochain démarrage.

#sudo mv /var/opt/sonar/extensions/plugins/sonar-surefire-plugin-2.1.jar /var/opt/sonar/extensions/deprecated


le plugin Squid était installé en version 2.1, et le plugin standard Java est mis à jour avec la version 2.5.1, entraînant une erreur lors du démarrage. Le message suivant est affiché dans la log sonar.log.

2015.08.27 10:25:38 ERROR [o.s.s.p.PlatformLifecycleListener]  Fail to start server
org.sonar.updatecenter.common.exception.IncompatiblePluginVersionException: The plugins 'squidjava' and 'java' must have exactly the same version as they belong to the same group.
        at org.sonar.updatecenter.common.PluginReferential.getParentRelease(PluginReferential.java:132) ~[sonar-update-center-common-1.8.jar:na]
        at org.sonar.updatecenter.common.PluginReferential.setParent(PluginReferential.java:120) ~[sonar-update-center-common-1.8.jar:na]
        at org.sonar.updatecenter.common.PluginReferentialManifestConverter.fromPluginManifests(PluginReferentialManifestConverter.java:54) ~[sonar-update-center-common-1.8.jar:na]
        at org.sonar.server.plugins.PluginReferentialMetadataConverter.getInstalledPluginReferential(PluginReferentialMetadataConverter.java:40) ~
[PluginReferentialMetadataConverter.class:na]
        at org.sonar.server.plugins.InstalledPluginReferentialFactory.init(InstalledPluginReferentialFactory.java:48) ~[InstalledPluginReferentialFactory.class:na]
        at org.sonar.server.plugins.InstalledPluginReferentialFactory.start(InstalledPluginReferentialFactory.java:37) ~[InstalledPluginReferentialFactory.class:na]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_72]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_72]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_72]
        at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_72]

Le plugin Squid ayant été intégré dans le plugin Java, la précédente version est placée dans le répertoire deprecated, entraînant sa suppression lors du prochain démarrage.

#sudo mv /var/opt/sonar/extensions/plugins/sonar-squid-java-plugin-2.1.jar /var/opt/sonar/extensions/deprecated


Icon-database-process.png Mise à jour de la base

Pour cette version, une mise à jour de la base de données est nécessaire, ce qui est indiqué dans la trace d'exécution de Tomcat.

Database must be upgraded. Please browse /setup

Celle-ci se déclenche en accédant à l'URL http://SERVER/sonar/setup.


Viewer icon.png Voir Aussi

Upgrade Notes: https://docs.sonarqube.org/display/SONARQUBE53/Release+4.2+Upgrade+Notes