edubriguenti
11/8/2013 - 10:50 AM

Sonar Ant Build

Sonar Ant Build

<project name="My Project" default="all" basedir="."
	xmlns:sonar="antlib:org.sonar.ant">
	<!--
	<property name="sonar.jdbc.url"
		value="jdbc:mysql://localhost:3306/sonar?useUnicode=true&amp;characterEncoding=utf8" />
		-->
		
	<property name="sonar.host.url" value="http://localhost:9000" />	
	<property name="sonar.jdbc.username" value="sonar" />
	<property name="sonar.jdbc.password" value="sonar" />
	<!-- Define the SonarQube project properties -->
	<property name="sonar.projectKey" value="org.codehaus.sonar:example-java-ant" />
	<property name="sonar.projectName"
		value="Simple Java Project analyzed with the SonarQube Ant Task" />
	<property name="sonar.projectVersion" value="1.0" />
	<property name="sonar.language" value="java" />
	<property name="sonar.sources" value="C:\liferay-portal-src-6.2.0-ce-ga1\portal-service\src" />
	<property name="sonar.binaries" value="C:\liferay-portal-src-6.2.0-ce-ga1\portal-service\classes" />
	<!-- Define the SonarQube target -->
	<target name="sonar">
		<taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml">
			<!--
				Update the following line, or put the "sonar-ant-task-*.jar" file in
				your "$HOME/.ant/lib" folder
			-->
			<classpath path="./sonar-ant-task-*.jar" />
		</taskdef>

		<!-- Execute Sonar -->
		<sonar:sonar />
	</target>


</project>