Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: SONAR-RUNNER-1.0
-
Component/s: Sonar Runner
-
Labels:None
-
Number of attachments :
Description
A project analysis should be started from an independent Java program, outside build tools like maven or ant. For example :
java -jar sonar-batch.jar my-project.properties
The first parameter is the location of the project configuration file. It defines metadata like source and binary directories, project key, language or name.
project.key=my:project project.name=My project project.version=1.0 project.sources=src/main/java project.sources=src/main/resources project.binaries=output/classes project.language=java sonar.dynamicAnalysis=reuseReports sonar.surefire.reports=output/junit/
Parameters can also be defined from command-line :
java -jar sonar-batch.jar my-project.properties -Dsonar.host.url=http://localhost:9000 -Dsonar.jdbc.url=jdbc:derby://localhost:1527/sonar
The main JAR contains the bootstrapper. It downloads batch and plugin libraries from server.
Issue Links
- depends upon
-
SONAR-2106
New Java library to bootstrap project analysis
-
- is related to
-
SONAR-2123
New annotation to allow specify in which environments BatchExtension should be active
-
-
SONAR-2148
New properties to manage level of Java language
-
-
SONAR-2151
New property to manage source encoding
-
-
SONAR-2172
API: New extension point - Initializer
-
Couple of notes (after investigations made for SONAR-1514) about how this program should start execution :
SONAR-2106to create ClassLoader with sonar-batch and its dependenciesSo in final JAR we will include only bootstrapper.
I believe that this technique flexible enough and can be used not only by Ant and Java program, but also by other build-tools. But I'm not sure about IDEs.