The GAE SDK generates a project that is not Maven enabled. Namely, source and target directories does not follow Maven conventions.
Sonar may be run against such a project by using Sonar light mode configuration.
- We will write a minimal POM project and instruct Sonar to run only static analysis (code violations, complexity).
- For the time being, we will put dynamic analysis (unit test results and code coverage) aside as it requires code to be executed, therefore dependencies configuration. Sonar may actually report dynamic analysis if surefire and cobertura reports are available.
But let's start with some simple configuration.
You will need Sonar (1.8 minimum) and Maven 2.
You will need Sonar (1.8 minimum) and Maven 2.
Write a POM
Open the Eclipse project generated by GAE SDK and create a pom.xml file at the project's root.
Depending on your repository and mirror, you may have to download sonar jars from the Codehaus repository.

Run Sonar
Now run sonar from the shell command line or configure an Eclipse launcher. As the Sonar maven plugin will send out data to Sonar during the build, the Sonar server must be running.
It may take a while the first time, as maven will download tons of libraries and plugins.
You may find usefull information about Sonar configuration including "Non-Maven" projects in Analyzing Java Projects
Aucun commentaire:
Enregistrer un commentaire