Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8110123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:38:37+00:00 2026-06-06T01:38:37+00:00

I am setting up a Sonar project (using the delphi plugin), for simplicity sake

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T01:38:38+00:00Added an answer on June 6, 2026 at 1:38 am

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to create two sets of Sonar reports from the same project.
Setting up a project structure; I am thinking is it better to have somewhat
Setting onchange event for CheckBoxList using the following code doesn't work. chkListUserGroup.Attributes.Add(onchange, document.forms[0].isRecordModified.value='true';); How
Setting up environment variables for hundreds of tests get old very quick. Is there
Setting: Multiplayer team game. Problem: Each player has a 1 to 5 star rating
Setting: A pseudo-random pattern has to be generated. There are several ways / or
When setting a SearchBarDisplay, using IB or programmatically it gets a Cancel button right
Setting up SVN using Apple Developer Connection manual ( http://developer.apple.com/mac/articles/server/subversionwithxcode3.html ). Regardless of it,
Setting focus on a form element using JavaScript is usually very straight forward. I
Setting aside the heap's capacity, are there ways to go beyond Integer.MAX_VALUE constraints in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.