Menu

Integrate JAVA Custom PMD Rules in Sonar 4.1.2

Help
TotoSonar
2014-08-11
2015-07-14
  • TotoSonar

    TotoSonar - 2014-08-11

    Hi,

    I wrote some custom PMD rules in Java (JAVA classes that extends AbstractJavaRule) and I want to use my rules in Sonarqube 4.1.2.

    When I was using sonarqube 3.7 I put the rules (.jar) and the extensions.xml file in extensions\rules\pmd, but this solution seem not work with sonarqube 4.1.2

    I tried to put the rules in extensions\plugin without success.

    So, do you know if there is a solution to use and activate my pmd custom rules with sonarqube 4.1.2 ?

    And do you know why SonarQube does not want to use PMD anymore ? (the plugin still exists but they developp their own AST lib do write custom rules http://docs.codehaus.org/display/SONAR/Extending+Coding+Rules)

    Thanks a lot,

     
  • Em Nguyen

    Em Nguyen - 2015-01-23

    Hello,

    I have not used Sonarqube 4.1.2 but I have tested with Sonar 5.0. I put rules (.jar file) and ruleset (.xml) ito extensions/rules/pmd and it work well.

    You may retest it.

     
    • Rohit Batta

      Rohit Batta - 2015-07-14

      Hi,

      I have tried same steps mentioned above to add custom written java pmd checks. But, those rules are not visible in sonarqube application.

      I am using sonarqube 5.1.1

      I have added custom jars and xml rule set file to folder <SONAR_HOME>/extensions/rules/pmd.

      Thanks in advance,
      Rohit

       

Log in to post a comment.