1

We have integrated Jenkins with Sonar(4.1). And added PHP plugin as an extension but Sonar server is not starting . When we remove this plugin it runs fine. For this reason we are not able to use codesniffer for php. Please help.

Thanks in advance.

  • What do your logs say when you attempt to start? IS there an error thrown somewhere? – Rob Allen Jun 16 '14 at 14:48
  • I get : org.sonar.api.utils.MessageException: The definition of the profile 'All PHPMD Rules' (language 'php') contains multiple occurrences of the 'phppmd_rules:Unused Code Rules/UnusedPrivateMethod' rule. The plugin which declares this profile should fix this. – Cap. Nik Sparrow Jun 17 '14 at 06:40
  • Can you edit your question to give more details about your installation? Which version of the PHP plugin are you using? It looks like you're trying to run an incompatible version of the plugin. – Fabrice - SonarSource Team Jun 17 '14 at 07:29
  • Sure Fabrice, We are using the sonar-php-plugin version 1.2 (as we want to use Codesniffer) and our SonarQube version is 4.x – Cap. Nik Sparrow Jun 17 '14 at 09:21
  • This PHP plugin has been fully rewritten to not depend anymore on third party tools: http://docs.codehaus.org/display/SONAR/PHP+Plugin. Version 2.1 should be used but indeed this version doesn't rely anymore on CodeSniffer – Freddy - SonarSource Team Jun 19 '14 at 09:56

1 Answers1

0
  1. Download latest version of sonar-php-plugin-2.2.jar (http://docs.codehaus.org/display/SONAR/PHP+Plugin)

  2. Restart your SonarQube server

  3. yourHostName:9000/setup

Those operations can resolve your problems.

Saranga
  • 3,178
  • 1
  • 18
  • 26