Sonar plugin not working for projects that use ANT as a build script

前端 未结 1 589
抹茶落季
抹茶落季 2021-01-14 19:45

Problem

I have just installed the Sonar Jenkins plugin. I went into my configured job (a free style job) that produces a WAR file artifact through a

相关标签:
1条回答
  • 2021-01-14 20:17

    Like Oers suggested on my question comments if you are using ANT as a build script in your CI server (Jenkins in my case) you will have to use the SONAR-ANT-TASK to generate Sonar reports, do as follows:

    1. Download MySQL or any other Sonar supported RDBMS such as Postgres, Oracle, etc..'
    2. Download and Install sonar server.
    3. go to (sonar installation folder)/extras/database/mysql and run the create_database.sql script.
    4. I had to run an extra sql statement in my case using mysql, you can see here Unable to access Sonar MySQL database Caused by: java.sql.SQLException: Access denied for user 'sonar'@'glassfishdev.ccs.local' (using password: YES)
    5. Start Sonar by typing ./sonar.sh start
    6. Add the sonar ant task to your build script. You can follow this template http://docs.codehaus.org/display/SONAR/Analyse+with+Ant+Task+1.0
    7. DO NOT check the sonar check box in your Configure screen if you have the Hudson Sonar plugin for installed, as this plugin only works with Maven projects.
    8. Click the "Build Now" button. If everything above has been done correctly you should be able to see the reports at http://ipaddressofmachinesonarisinstalled:9000/

    Hope this helps, -Dario

    0 讨论(0)
提交回复
热议问题