I dont understand XML,
But Looking the Tutorial, i created the ant builfile -> projecBuilder.xml in the web application Project in Eclipse (GWT)
With help of projectBuilder.xml i create a jar file for all the java files in client, shared , server.
Now i want to add Sonar as a target in projectbuilder.xml.
I have dowloaded sonar 2.12,
sonar ant task. both are in in Drive D:/
What i have done :
<?xml version="1.0" encoding="UTF-8"?>
<target name="create_jars" depends='create_jars_client,create_jars_server,
create_jars_shared,sonar' />
<!--Client-->
<target name="create_jars_client">
<echo message = 'Remove Existing Jars'/>
<delete file="com/example/TryAnt/Client/TryAnt.jar" />
<echo message='Create new jars' />
<jar basedir='${classes}' jarfile="com/example/TryAnt/Client/TryAnt.jar"
includes ='WEB-INF\classes\com\example\TryAnt\client\TryAnt.class'/>
</target>
<!--... Similar more code for creating jar-->
i used above link link to solve further .
i copied paste the code but it show me error.
Please tell me what are the things to be changed.
please any one can explain me how to analyse code in sonar by using ant build file in a very simple language.
FInally i solved it with help of many blogs and want to share with everyone.
1.Download Ant http://ant.apache.org/bindownload.cgi
2.Unzip it and rename it to ant
3.SET enviornment variable , to do it on command prompt type this (Assume Ant is installed in D:\ant.)
Check ANT works correctly or not. In the command prompt, type:
5.Do not close Command Prompt
Add Sonar
1.Download Sonar 2.12 from link http://www.sonarsource.org/downloads/
2.Unzip the Download .
3.On windows command prompt execute bin\windows-x86-64\StartSonar.bat
4.Browse to http://localhost:9000
5.For administration features, default login/password is admin/admin
For Analyzing with Ant
1.Download Sonar Ant Task from link http://docs.sonarqube.org/display/SONARQUBE44/Analyzing+with+SonarQube+Ant+Task
2.Copy this jar File sonar-ant-task-1.3 to lib of Ant folder (D:\ant\lib).
3.Copy jar file to eclipse\plugins\org.apache.ant_1.8.2.v20110505-1300
Ant file for the project in Eclipse.
1.For Creating a Ant File in eclipse check link
http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2FgettingStarted%2Fqs-93_project_builder.htm
2.In buid.xml
Write code