MSBuild: how to use the nested properties like in Ant - ant

I have batch of properties in my MSBuild configuration file
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<USERNAME1_DropboxPublic>e:\path\to\Dropbox\for\first\user</USERNAME1_DropboxPublic>
<USERNAME2_DropboxPublic>e:\path\to\Dropbox\for\second\user</USERNAME2_DropboxPublic>
<USERNAME3_DropboxPublic>e:\path\to\Dropbox\for\third\user</USERNAME3_DropboxPublic>
</PropertyGroup>
....
</Project>
And I want to get property depends on current the username.
Also I know that ant solves this problem by using nested properties like this ${${user.name}_DropboxPublic}
How can I solve this problem with MSBuild tool?

Here are some of the "tricks".
Save the below xml into a file called "MSBuild_Conditionals.xml"
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="AllTargetsWrapper">
<!-- -->
<PropertyGroup>
<MyFavoriteFoodComplement Condition="'$(FavoriteFood)'=='PeanutButter'">Jelly</MyFavoriteFoodComplement>
<MyFavoriteFoodComplement Condition="'$(FavoriteFood)'=='Steak'">Potatoes</MyFavoriteFoodComplement>
<!-- Check to see if a match was given (by seeing if the variable value is an empty string), if no match (aka, an empty string), do a default -->
<MyFavoriteFoodComplement Condition="'$(MyFavoriteFoodComplement)'==''">CookiesTheDefaultFavoriteFoodComplement</MyFavoriteFoodComplement>
</PropertyGroup>
<Choose>
<When Condition=" '$(Configuration)'=='Debug' ">
<PropertyGroup>
<MyChooseVariable001>DebugSuffix001</MyChooseVariable001>
<MyChooseVariable002>DebugSuffix002</MyChooseVariable002>
<MyChooseVariable003>DebugSuffix003</MyChooseVariable003>
</PropertyGroup>
</When>
<When Condition=" '$(Configuration)'=='Release' ">
<PropertyGroup>
<MyChooseVariable001>ReleaseSuffix001</MyChooseVariable001>
<MyChooseVariable002>ReleaseSuffix002</MyChooseVariable002>
<MyChooseVariable003>ReleaseSuffix003</MyChooseVariable003>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<MyChooseVariable001>DefaultValue001</MyChooseVariable001>
<MyChooseVariable002>DefaultValue002</MyChooseVariable002>
<MyChooseVariable003>DefaultValue003</MyChooseVariable003>
</PropertyGroup>
</Otherwise>
</Choose>
<!-- -->
<Target Name="TestCreateProperty">
<CreateProperty Value="Here is a created property using another property : $(MyFavoriteFoodComplement)">
<Output TaskParameter="Value" PropertyName="MyCreateProperty" />
</CreateProperty>
<Message Text=" MyCreateProperty = $(MyCreateProperty)" />
<Message Text=" " />
<CreateProperty Condition="'$(FavoriteFood)'=='PeanutButterX'" Value="Conditional Create Property : $(MyFavoriteFoodComplement)">
<Output TaskParameter="Value" PropertyName="MyCreatePropertyWithCondition" />
</CreateProperty>
<CreateProperty Condition="'$(MyCreatePropertyWithCondition)'==''" Value="Conditional Create Property : DEFAULT">
<Output TaskParameter="Value" PropertyName="MyCreatePropertyWithCondition" />
</CreateProperty>
<Message Text=" MyCreatePropertyWithCondition = $(MyCreatePropertyWithCondition)" />
</Target>
<!-- -->
<Target Name="ShowVariables">
<Message Text="Configuration = $(Configuration)" />
<Message Text="FavoriteFood = $(FavoriteFood)" />
<Message Text=" " />
<Message Text="MyFavoriteFoodComplement = $(MyFavoriteFoodComplement)" />
<Message Text="MyChooseVariable001 = $(MyChooseVariable001)" />
<Message Text="MyChooseVariable002 = $(MyChooseVariable002)" />
<Message Text="MyChooseVariable003 = $(MyChooseVariable003)" />
</Target>
<!-- -->
<!-- -->
<!-- -->
<Target Name="AllTargetsWrapper">
<!-- -->
<CallTarget Targets="ShowVariables" />
<!-- -->
<CallTarget Targets="TestCreateProperty" />
<!-- -->
</Target>
<!-- -->
</Project>
Save this into a .bat file.
set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v3.5
call %msBuildDir%\msbuild.exe MSBuild_Conditionals.xml /p:Configuration=Release;FavoriteFood=PeanutButter /l:FileLogger,Microsoft.Build.Engine;logfile=MSBuild_Conditionals_LOG.log
set msBuildDir=
Output (with the parameters in the .bat file above)
Build started 6/01/2013 11:33:33 PM.
__________________________________________________
Project ".\MSBuild_Conditionals.xml" (default targets):
Target AllTargetsWrapper:
Target ShowVariables:
Configuration = Release
FavoriteFood = PeanutButter
MyFavoriteFoodComplement = Jelly
MyChooseVariable001 = ReleaseSuffix001
MyChooseVariable002 = ReleaseSuffix002
MyChooseVariable003 = ReleaseSuffix003
Target TestCreateProperty:
MyCreateProperty = Here is a created property using another property : Jelly
MyCreatePropertyWithCondition = Conditional Create Property : DEFAULT
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:00.01

Related

ColdFusion TestBox Ant error

My goal is to run TestBox scripts on Jenkins. But using the Ant script from
https://testbox.ortusbooks.com/content/running_tests/ant_runner.html
as a template, I get this error
BUILD FAILED
C:\public\data\trunk\AutomatedTesting\Box_Unit_Tests\build.xml:38: The reference to entity "bundles" must end with the ';' delimiter.
with this script:
<?xml version="1.0" encoding="UTF-8"?>
<project name="testbox-ant-runner" default="init" basedir=".">
<!-- THE URL TO THE RUNNER, PLEASE CHANGE ACCORDINGLY-->
<property name="basedir" value="C:\public\data\trunk\AutomatedTesting\Box_Unit_Tests" />
<property name="url.runner" value="C:\public\data\ColdBox\testbox\test-harness\runner.cfm?"/>
<!-- FILL OUT THE BUNDLES TO TEST, CAN BE A LIST OF CFC PATHS -->
<property name="test.bundles" value="http://localhost/application/testing/TestBox/Hello.cfc?method=runRemote" />
<!-- FILL OUT THE DIRECTORY MAPPING TO TEST -->
<property name="test.directory" value="test.specs" />
<!-- FILL OUT IF YOU WANT THE DIRECTORY RUNNER TO RECURSE OR NOT -->
<property name="test.recurse" value="true" />
<!-- FILL OUT THE LABELS YOU WANT TO APPLY TO THE TESTS -->
<property name="test.labels" value="" />
<!-- FILL OUT THE TEST REPORTER YOU WANT, AVAILABLE REPORTERS ARE: ANTJunit, Codexwiki, console, dot, doc, json, junit, min, raw, simple, tap, text, xml -->
<property name="test.reporter" value="simple" />
<!-- FILL OUT WHERE REPORTING RESULTS ARE STORED -->
<property name="report.dir" value="${basedir}\results" />
<property name="junitreport.dir" value="${report.dir}\junitreport" />
<target name="init" description="Init the tests">
<mkdir dir="${junitreport.dir}" />
<tstamp prefix="start">
<format property="TODAY" pattern="MM-dd-YYYY hh:mm:ss aa"/>
</tstamp>
<concat destfile="${report.dir}\Latestrun.log">Tests ran at ${start.TODAY}</concat>
</target>
<target name="run">
<get dest="${report.dir}/results.html"
src="${url.runner}&bundles=${test.bundles}&reporter=${test.reporter}"
verbose="true"/>
<-- Create fancy junit reports -->
<junitreport todir="${junitreport.dir}">
<fileset dir="${report.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${junitreport.dir}">
<param name="TITLE" expression="My Awesome TestBox Results"/>
</report>
</junitreport>
</target>
</project>
Any thoughts?

Jacoco not excluding the class from the report using exclude function

I am using jacoco with Ant and with the build.xml given below. I want to exclude eQMIUtil class from util.3.5 jar. But I am getting all the methods while generating report. Is there any way I can get a solution for this. What does **<arg value= "2*3+4">** actually do?
<description>
Example Ant build file that demonstrates how a JaCoCo coverage report
can be itegrated into an existing build in three simple steps.
</description>
<!-- property name="src.dir" location="./src/main/java" />
<property name="result.dir" location="./target" />
<property name="result.classes.dir" location="${result.dir}/classes" />
<property name="result.report.dir" location="${result.dir}/site/jacoco" />
<property name="result.exec.file" location="${result.dir}/jacoco.exec" /-->
<property name="activity.src.dir" location="./src/MIActivities" />
<property name="modules.src.dir" location="./src/Modules" />
<property name="plugins.src.dir" location="./src/Plugins" />
<property name="classes.src.dir" location="F:/jacoco/test/classes" />
<property name="result.dir" location="./target" />
<property name="result.classes.dir" location="${result.dir}/classes" />
<property name="result.Activities.dir" location="F:/Tomcat/apache-tomcat6/webapps/MI35PCQA01P/Activities" />
<property name="result.report.dir" location="F:/Jacoco/test/target/site" />
<property name="result.exec.file1" location="F:/Jacoco/jacoco.exec" />
<property name="project.parent.build.directory" location="C:/MIWork/Jacoco/Coverage" />
<!-- Step 1: Import JaCoCo Ant tasks -->
<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
<classpath path="F:/Jacoco/jacoco-0.7.5.201505241946/lib/jacocoant.jar" />
</taskdef>
<target name="clean">
<delete dir="${result.report.dir}" />
</target>
<target name="report" >
<jacoco:report>
<executiondata>
<file file="${result.exec.file1}"/>
</executiondata>
<structure name="Example Project">
<classfiles>
<fileset file="${classes.src.dir}/util-3.5.jar" >
<exclude name="**/*eQMIUtil*.class"/>
</fileset>
</classfiles>
<sourcefiles encoding="UTF-8">
</sourcefiles>
</structure>
<html destdir="${result.report.dir}"/>
</jacoco:report>
</target>
<target name="test" depends="report">
<!-- Step 2: Wrap test execution with the JaCoCo coverage task -->
<jacoco:coverage destfile="${result.exec.file}">
<java classname="org.jacoco.examples.parser.Main" fork="true">
<classpath path="${result.classes.dir}" />
<arg value="2 * 3 + 4"/>
<arg value="2 + 3 * 4"/>
<arg value="(2 + 3) * 4"/>
<arg value="2 * 2 * 2 * 2"/>
<arg value="1 + 2 + 3 + 4"/>
<arg value="2 * 3 + 2 * 5"/>
</java>
</jacoco:coverage>
</target>
<target name="finalreport" depends="test">
<!-- Step 3: Create coverage report -->
<jacoco:report>
<!-- This task needs the collected execution data and ... -->
<executiondata>
<file file="${result.exec.file}" />
</executiondata>
<!-- the class files and optional source files ... -->
<structure name="JaCoCo Ant Example">
<classfiles>
<fileset dir="${result.classes.dir}" />
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="${src.dir}" />
</sourcefiles>
</structure>
<!-- to produce reports in different formats. -->
<html destdir="${result.report.dir}" />
<csv destfile="${result.report.dir}/report.csv" />
<xml destfile="${result.report.dir}/report.xml" />
</jacoco:report>
</target>
<target name="rebuild" depends="clean,report" />
Instead of nesting a <fileset> under <jacoco:report>, you can nest a <zipfileset> instead.
This...
<jacoco:report>
...
<structure name="Example Project">
<classfiles>
<fileset file="${classes.src.dir}/util-3.5.jar" >
<exclude name="**/*eQMIUtil*.class"/>
</fileset>
</classfiles>
...
</structure>
...
</jacoco:report>
...should become...
<jacoco:report>
...
<structure name="Example Project">
<classfiles>
<zipfileset src="${classes.src.dir}/util-3.5.jar">
<exclude name="**/*eQMIUtil*.class"/>
</zipfileset>
</classfiles>
...
</structure>
...
</jacoco:report>
<zipfileset> works because JAR files are also ZIP files.

MSBuild - Circular dependency in the target dependency graph

I am getting the following error in my build
Error MSB4006: There is a circular dependency in the target dependency graph involving target "DoPublish".
The DoPublish is triggering Publish and I assume the Build. How can I avoid this.
I am using the Visual Studio build. I was using the MSBUILD with the targets /t:UpdateVersion;DoPublish;publish, which worked. I would like to use the Visual Studio build in TFS instead of MSBUILD
Project:
<Target Name="UpdateVersion" AfterTargets="PostBuildEvent">
<RevisionTask>
<Output TaskParameter="PublishVersion" PropertyName="PublishVersion" />
</RevisionTask>
<Message Text="The Version is $(PublishVersion)" Importance="high" />
<PropertyGroup>
<ApplicationVersion>$(PublishVersion)</ApplicationVersion>
</PropertyGroup>
<ItemGroup>
<ConfigFile Include="$(MSBuildProjectDirectory)\Configs\$(Configuration)\AppDeploy.config" />
</ItemGroup>
<Copy SourceFiles="#(ConfigFile)" DestinationFolder="$(TargetDir)" Condition=" '$(Configuration)' == 'DEV' OR '$(Configuration)' == 'SIT' OR '$(Configuration)' == 'UAT' " ContinueOnError="true" />
<Copy SourceFiles="#(ConfigFile)" DestinationFolder="$(MSBuildProjectDirectory)" Condition=" '$(Configuration)' == 'DEV' OR '$(Configuration)' == 'SIT' OR '$(Configuration)' == 'UAT' " ContinueOnError="true" />
<Message Text="Copying File from $(MSBuildProjectDirectory)\Configs\$(Configuration)\Web.config to $(TargetDir)" Importance="high" />
</Target>
<Target Name="DoPublish" AfterTargets="UpdateVersion" Condition=" '$(BuildingInsideVisualStudio)' != '' ">
<MSBuild Projects="$(ProjectFileName)" Targets="Publish" Properties="ApplicationVersion=$(PublishVersion)" />
<!-- Write publish.htm file for ClickOnce -->
<Message Text="FileUpdate - $(ProjectDir)\Configs\publish.htm: Replace {PublishVersion} with $(PublishVersion)" Importance="high" />
<FileUpdate Files="$(ProjectDir)\Configs\publish.htm" IgnoreCase="true" Multiline="true" Singleline="false" Regex="{PublishVersion}" ReplacementText="$(PublishVersion)" />
<Message Text="FileUpdate - $(ProjectDir)\Configs\publish.htm: Replace {AssemblyName} with $(AssemblyName)" Importance="high" />
<FileUpdate Files="$(ProjectDir)\Configs\publish.htm" IgnoreCase="true" Multiline="true" Singleline="false" Regex="{AssemblyName}" ReplacementText="$(AssemblyName)" />
<Message Text="FileUpdate - $(ProjectDir)\Configs\publish.htm: Replace {ProductName} with $(ProductName)" Importance="high" />
<FileUpdate Files="$(ProjectDir)\Configs\publish.htm" IgnoreCase="true" Multiline="true" Singleline="false" Regex="{ProductName}" ReplacementText="$(ProductName)" />
<Copy SourceFiles="$(ProjectDir)\Configs\publish.htm" DestinationFiles="$(PublishDir)publish.htm" />
</Target>
I created a web app project and tested this on my environment (TFS2015) with following of your code kept:
<Target Name="UpdateVersion" AfterTargets="PostBuildEvent">
<Message Text="The Version is $(PublishVersion)" Importance="high" />
<PropertyGroup>
<ApplicationVersion>$(PublishVersion)</ApplicationVersion>
</PropertyGroup>
<Message Text="Copying File from $(MSBuildProjectDirectory)\Configs\$(Configuration)\Web.config to $(TargetDir)" Importance="high" />
</Target>
<Target Name="DoPublish" AfterTargets="UpdateVersion" Condition="'$(BuildingInsideVisualStudio)' != 'true'">
<MSBuild Projects="$(ProjectFileName)" Targets="Publish" />
</Target>
But I couldn't reproduce this issue. The build can be completed successfully. I can only see MSB4006 error when "Target="Publish" isn't added in "DoPublish" target.
I changed Condition=" '$(BuildingInsideVisualStudio)' != '' " to Condition="'$(BuildingInsideVisualStudio)' != 'true'" as the BuildingInsideVisualStudio value is always empty under my environment. "DoPublish" target does not run with Condition=" '$(BuildingInsideVisualStudio)' != '' ".
Since I cannot add comment, I have a question need to check here: What do you mean by using the Visual Studio build in TFS instead of MSBUILD?
After seeing this post I came up with similar solution overriding the AfterPubish target.
To correct the circular dependency, just change the target name to AfterPublish and removed the AfterTargerts attribute.
<Target Name="AfterPublish" Condition=" '$(BuildingInsideVisualStudio)' != '' ">
<MSBuild Projects="$(ProjectFileName)" Targets="Publish" Properties="ApplicationVersion=$(PublishVersion)" />
<!-- Write publish.htm file for ClickOnce -->
<Message Text="FileUpdate - $(ProjectDir)\Configs\publish.htm: Replace {PublishVersion} with $(PublishVersion)" Importance="high" />
<FileUpdate Files="$(ProjectDir)\Configs\publish.htm" IgnoreCase="true" Multiline="true" Singleline="false" Regex="{PublishVersion}" ReplacementText="$(PublishVersion)" />
<Message Text="FileUpdate - $(ProjectDir)\Configs\publish.htm: Replace {AssemblyName} with $(AssemblyName)" Importance="high" />
<FileUpdate Files="$(ProjectDir)\Configs\publish.htm" IgnoreCase="true" Multiline="true" Singleline="false" Regex="{AssemblyName}" ReplacementText="$(AssemblyName)" />
<Message Text="FileUpdate - $(ProjectDir)\Configs\publish.htm: Replace {ProductName} with $(ProductName)" Importance="high" />
<FileUpdate Files="$(ProjectDir)\Configs\publish.htm" IgnoreCase="true" Multiline="true" Singleline="false" Regex="{ProductName}" ReplacementText="$(ProductName)" />
<Copy SourceFiles="$(ProjectDir)\Configs\publish.htm" DestinationFiles="$(PublishDir)publish.htm" />
</Target>

Configuration of build.xml file for Sonar modules with Ant

I am setting up a Sonar project (using the delphi plugin), for simplicity sake assume there are two modules I want to report on.
Each module is in it's own sub-folder and each has it's own build.xml file.
At this point I can successfully run the sonar tasks and generate reports for each module as an independent project.
My problem is with configuring the "master" build.xml file.
The module build.xml file looks like this:
<?xml version="1.0"?>
<project name = "CRM" default = "sonar" basedir = ".">
<!-- Add the Sonar task -->
<taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml">
<classpath path="c:/ANT/lib" />
</taskdef>
<target name="sonar">
<property name="sonar.projectKey" value="EXO:CRM" />
<property name="sonar.host.url" value="http://localhost:9000" />
<sonar:sonar workDir="." key="CRM.key" version="0.1" xmlns:sonar="antlib:org.sonar.ant">
<property key="sonar.sources" value="." /> <!-- project sources directories (required) -->
<property key="sonar.language" value="delph" /> <!-- project language -->
<property key="sonar.delphi.codecoverage.excluded" value=".\tests" /> <!-- code coverage excluded directories -->
<property key="sonar.importSources" value="true" /> <!-- should we show sources or not? -->
<property key="sonar.delphi.sources.excluded" value="" /> <!-- excluded directories -->
<property key="sonar.delphi.sources.include" value=".\includes" /> <!-- include directories, "," separated -->
<property key="sonar.delphi.sources.include.extend" value="true" /> <!-- should we extend includes in files? -->
</sonar:sonar>
</target>
</project>
The "Master" build.xml looks like this:
<?xml version="1.0"?>
<project name = "EXO" default = "sonar" basedir = ".">
<taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml">
<classpath path="c:/ANT/lib" />
</taskdef>
<target name="sonar">
<property name="sonar.modules" value="exonet6000/build.xml,CRM/build.xml" />
<sonar:sonar workDir="." key="EXO.key" version="0.1" xmlns:sonar="antlib:org.sonar.ant">
<!-- project sources directories (required) -->
<property key="sonar.sources" value="." />
<property key="sonar.language" value="delph" />
<property key="sonar.importSources" value="true" />
<property key="sonar.delphi.sources.excluded" value="" />
<property key="sonar.delphi.sources.include" value=".\includes" />
<property key="sonar.delphi.sources.include.extend" value="true" />
</sonar:sonar>
</target>
</project>
It is always scanning all sources (required value) i.e. it is not respecting my modules.
The only way I can get this to work currently is by limiting the source code like this
<property key="sonar.sources" value="./crm/,./exonet6000/" />
I'm sure I must be mis-configuring something obvious here.
EDIT: I have now what I believe is a more consistent set of files based on examples here https://github.com/SonarSource/sonar-examples/tree/master/projects/languages/java/java-ant-modules
Master build file:
<?xml version="1.0" encoding="UTF-8"?>
<project name = "EXO" default = "sonar" basedir = "." xmlns:sonar="antlib:org.sonar.ant">
<echo>Root Project</echo>
<taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml">
<classpath path="c:/ANT/lib" />
</taskdef>
<property name="sonar.host.url" value="http://localhost:9000" />
<property name="sonar.modules" value="exonet6000/build.xml,CRM/build.xml" />
<target name="sonar">
<sonar:sonar key="EXO.key" version="0.1">
</sonar:sonar>
</target>
</project>
and one of the submodule files
<?xml version="1.0" encoding="UTF-8"?>
<project name="CRM" default="all" basedir=".">
<echo>CRM Module</echo>
<property name="sonar.language" value="delph" />
<property name="sonar.projectKey" value="EXO:CRM" />
<property name="sonar.sources" value="." />
<target name="all" />
</project>
At this point the sonar process is completing successfully BUT no actual anlysis is being done. A key point is that I am not seeing the echo of the submodule so I suspect these build tasks are not actually running.
If you look at this sample project using Ant and multimodules, I'd say that you should not specify any property inside the tag in your master build.xml file, and let the submodules specify those properties.
I've got a project with many submodules. My sonar target looks like this:
<target name="sonar" depends="build.dependencies" description="collect code metrics">
<property name="m1" value="a/build.xml,b/build.xml,c/build.xml,d/build.xml"/>
... more properties defining modules...
<property name="sonar.modules" value="${m1},${m2},${m3},${m4},${m5},${m6}..."/>
<property name="sonar.projectName" value="MyProject"/>
<sonar:sonar key="my:project" version="${version}" xmlns:sonar="antlib:org.sonar.ant">
</sonar:sonar>
</target>
No property definitions in the sonar:sonar task at all, and it is working as I want it to.
Sources are defined in the submodule build.xml files. (Actually, in a base-build.xml that all our build.xml files include... but that's an Ant thing not directly related to Sonar.)

Why are my libraries not being imported into Sonar when using the Ant task?

We are evaluating Sonar and I've set up an Ant task to import my project data into Sonar using the instructions here but my libraries aren't appearing in the libraries view.
Apart from this it is working as all the other information is there.
Maybe I've misunderstood what the libraries element is for in the Ant task? Please can someone tell me what I'm missing?
From my build file:
<target name="sonar">
<sonar:sonar workDir="sonartemp" key="org.example:example" version="0.1-SNAPSHOT" xmlns:sonar="antlib:org.sonar.ant">
<!-- source directories (required) -->
<sources>
<path location="src/common/src" />
<path location="src/commonWidgets/src" />
<path location="src/compositionWidget/src" />
<path location="src/nativeLib/src" />
<path location="src/services/src" />
</sources>
<!-- list of properties (optional) -->
<property key="sonar.projectName" value="Test RPS Composition Import" />
<property key="sonar.dynamicAnalysis" value="true" />
<!-- test source directories (optional) -->
<tests>
<path location="src/common/test" />
<path location="src/commonWidgets/test" />
<path location="src/compositionWidget/test" />
<path location="src/services/test" />
</tests>
<!-- binaries directories, which contain for example the compiled Java bytecode (optional) -->
<binaries>
<path location="src/common/build" />
<path location="src/commonWidgets/build" />
<path location="src/compositionWidget/build" />
<path location="src/services/build" />
</binaries>
<!-- path to libraries (optional). These libraries are for example used by the Java Findbugs plugin -->
<libraries>
<path location="src/common/lib/**/" />
<path location="src/commonWidgets/lib/**/" />
<path location="src/compositionWidget/lib/**/" />
<path location="src/services/lib/" />
</libraries>
</sonar:sonar>
</target>
As far as I know this view only works with maven.
The libraries in the ant task definition are for the static analysis tools like findbugs.
This tab is information only and not needed for anything.

Resources