On Sat, Apr 30, 2011 at 6:07 PM, Joachim Van der Auwera
<[email protected]> wrote:
> Cool.
>
> Did you do anything special to get this to run? I tried running it on
> our ci/sonar system a couple of weeks ago but failed.

This is running on my development machine, so I just made a manual
maven run.
This is more or less the recipe:
- unpack sonar
- create a sonar user with sonar password for the postgres db system
- create a db named sonar with the sonar user
- go into sonar/conf/sonar.properties and comment out the embedded db,
  uncomment/set these instead:

sonar.jdbc.url:                            jdbc:postgresql://localhost/sonar
sonar.jdbc.driverClassName:                org.postgresql.Driver
sonar.jdbc.validationQuery:                select 1
sonar.jdbc.dialect=postgresql

- sonar/bin/<your_os>/sonar.sh start
- in $home/.m2/settings.xml add:

 <profiles>
  <profile>
      <id>sonar</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <properties>
        <sonar.jdbc.url>jdbc:postgresql://localhost/sonar</sonar.jdbc.url>
        <sonar.jdbc.username>sonar</sonar.jdbc.username>
        <sonar.jdbc.password>sonar</sonar.jdbc.password>
        <sonar.jdbc.driver>org.postgresql.Driver</sonar.jdbc.driver>
      </properties>
    </profile>
</profiles>

- following the user guide reccomendations at:
  http://docs.codehaus.org/display/SONAR/Analyse+with+Maven
 do in your project (for example, GeoTools):
 mvn clean install -Dtest=false -DfailIfNoTests=false -Dall
 mvn sonar:sonar -Dall -Psonar

- wait a lot, when the build finishes you should have the project information
  available at http://localhost:9000

Last week I tried with the embedded db and it was a real pain, looking
around they in fact say it's good only for demo purposes on small projects
with a small sonar build history

> I am a big fan of sonar. Especially the violations drilddown gives a lot
> of interesting information. While there are undoubtably a lot of false
> positives, most of the checks are worthwhile verifying. You can often
> just use a comment (and sometimes an annotation) to tell sonar to ignore
> the violations at a certain place (using "// NOPMD" for the pmd checks,
> or in general "// NOSONAR").

Ah, this is good to know in fact. I have seen some egregious false positives
around, _if_ someone pops up that can run the tool in a continous build
enviroment and we have Sonar running continuosly I'll definitely make use
of it.

For the moment I want to keep it running for a while on my dev machine,
long term, we'll see (afaik the opengeo build bot machine is already
quite overloaded, might not be able to take on these very long builds)

Cheers
Andrea

>
> Kind regards,
> Joachim
>
> On 04/30/2011 03:18 PM, Andrea Aime wrote:
>> Hi all,
>> today I had a quick try at Sonar, a tool that computes and publishes
>> software metrics aggregating results form tools such as Cobertura,
>> PMD, FindBugs and the like.
>>
>> The tool is meant to be used in conjuction with a continout build
>> system, but just to try it out I had it do a manual run on my local machine.
>> If my machine and the sonar server are up you should see the results here:
>> http://aaime.no-ip.org:9000
>>
>> I've chosen the "Sonar way + findbugs" profile, which runs a lot of tests.
>> As a result the analysis takes its dear time, 30 minutes on GeoTools for
>> example, and provides a ton of results which contain a number of
>> false positives and less than interesting information... nevertheless
>> some is worth looking at.
>>
>> Curious to hear what you think about the tool and the results.
>> If you want to see the results and the system is not up ping me
>> on IRC or mail and I'll try to bring it back
>>
>> Cheers
>> Andrea
>>
>
>
> --
> Joachim Van der Auwera
> Geosparc, supporting the Geomajas GIS community
>
>
> ------------------------------------------------------------------------------
> WhatsUp Gold - Download Free Network Management Software
> The most intuitive, comprehensive, and cost-effective network
> management toolset available today.  Delivers lowest initial
> acquisition cost and overall TCO of any competing solution.
> http://p.sf.net/sfu/whatsupgold-sd
> _______________________________________________
> Geotools-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>
>



-- 
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to