jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Sonar
  • SONAR-205

Ability to exclude sources or packages from quality control

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.7
  • Component/s: Metrics, Rules
  • Labels:
    None

Description

Checkstyle and PMD offer ways to exclude sources from quality control but Sonar doesn't use those mechanisms. Could be a good thing to activate and configure those filters from the Sonar web interface and propagate them to the Sonar maven plugin.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. XML File
    Administration_Project.xml
    03/Jan/09 4:14 PM
    12 kB
    Freddy Mallet
  1. Administration_Project.jpg
    113 kB
    03/Jan/09 4:15 PM

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
elyes alouini added a comment - 28/Mar/08 6:15 AM

It would be also nice to do it also for cobertura.

Show
elyes alouini added a comment - 28/Mar/08 6:15 AM It would be also nice to do it also for cobertura.
Hide
Permalink
Matt Stark added a comment - 29/Sep/08 5:26 PM

Further, would be good to exclude selected packages from JavaNCSS.

Show
Matt Stark added a comment - 29/Sep/08 5:26 PM Further, would be good to exclude selected packages from JavaNCSS.
Hide
Permalink
Freddy Mallet added a comment - 25/Dec/08 3:02 PM - edited

Here are the filters to use on each plugins :

  • Maven Checkstyle plugin, feed the configuration/excludes node with a comma-separated list of Ant patterns
    <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-checkstyle-plugin</artifactId>
       <configuration>
           <excludes>**/generated/**/*</excludes>
       </configuration>
    </plugin>
  • Maven PMD plugin, feed the configuration/excludes node with a comma-separated list of Ant patterns
    <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-pmd-plugin</artifactId>
       <configuration>
           <excludes>**/generated/**/*</excludes>
       </configuration>
    </plugin>
  • Maven Findbugs plugin, feed the configuration/excludeFilterFile node with a path to an existing findbugs-exclude.xml file located at the project root
    <plugin>
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>findbugs-maven-plugin</artifactId>
       <configuration>
          <excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
       </configuration>
    </plugin>

The content of the findbugs-exclude.xml file could be for instance :

<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
       <Match>
                <Package name="com.toto.generated" />
       </Match>
</FindBugsFilter>
  • Maven JavaNCSS plugin, feed configuration/excludes/exclude nodes with an Ant pattern
    <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-javancss-plugin</artifactId>
       <configuration>
          <excludes>
             <exclude>**/generated/**/*</exclude>
             <exclude>**/foobar.java</exclude>
           </excludes>
       </configuration>
    </plugin>
Show
Freddy Mallet added a comment - 25/Dec/08 3:02 PM - edited Here are the filters to use on each plugins :
  • Maven Checkstyle plugin, feed the configuration/excludes node with a comma-separated list of Ant patterns
    <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-checkstyle-plugin</artifactId>
       <configuration>
           <excludes>**/generated/**/*</excludes>
       </configuration>
    </plugin>
  • Maven PMD plugin, feed the configuration/excludes node with a comma-separated list of Ant patterns
    <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-pmd-plugin</artifactId>
       <configuration>
           <excludes>**/generated/**/*</excludes>
       </configuration>
    </plugin>
  • Maven Findbugs plugin, feed the configuration/excludeFilterFile node with a path to an existing findbugs-exclude.xml file located at the project root
    <plugin>
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>findbugs-maven-plugin</artifactId>
       <configuration>
          <excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
       </configuration>
    </plugin>
The content of the findbugs-exclude.xml file could be for instance :
<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
       <Match>
                <Package name="com.toto.generated" />
       </Match>
</FindBugsFilter>
  • Maven JavaNCSS plugin, feed configuration/excludes/exclude nodes with an Ant pattern
    <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-javancss-plugin</artifactId>
       <configuration>
          <excludes>
             <exclude>**/generated/**/*</exclude>
             <exclude>**/foobar.java</exclude>
           </excludes>
       </configuration>
    </plugin>
Hide
Permalink
Freddy Mallet added a comment - 06/Jan/09 3:22 PM

Clover and Cobertura plugins can also be configured to exclude sources.

Show
Freddy Mallet added a comment - 06/Jan/09 3:22 PM Clover and Cobertura plugins can also be configured to exclude sources.
Hide
Permalink
André Ribeiro added a comment - 17/Nov/10 9:59 AM

is it possible to re-open to implement the UI as suggested?
I've been struggling to configure the exclusion of some packages, dirs and classes from my sonar project but i cant figure it out!
alternatively, could you give a working example?
much thanks!

Show
André Ribeiro added a comment - 17/Nov/10 9:59 AM is it possible to re-open to implement the UI as suggested? I've been struggling to configure the exclusion of some packages, dirs and classes from my sonar project but i cant figure it out! alternatively, could you give a working example? much thanks!
Hide
Permalink
André Ribeiro added a comment - 17/Nov/10 10:01 AM

i meant for PMD (duplications detection)

Show
André Ribeiro added a comment - 17/Nov/10 10:01 AM i meant for PMD (duplications detection)
Hide
Permalink
Evgeny Mandrikov added a comment - 17/Nov/10 10:06 AM

Hi Andre,

This ticket wouldn't be reopened since it was fixed in version 1.7. Moreover I suggest you to ask such questions in user mailing list : http://www.sonarsource.org/support/support/

You can completely exclude resource from Sonar analyzes on project settings page or via maven property "sonar.exclusions".

Show
Evgeny Mandrikov added a comment - 17/Nov/10 10:06 AM Hi Andre, This ticket wouldn't be reopened since it was fixed in version 1.7. Moreover I suggest you to ask such questions in user mailing list : http://www.sonarsource.org/support/support/ You can completely exclude resource from Sonar analyzes on project settings page or via maven property "sonar.exclusions".

People

  • Assignee:
    Simon Brandhof
    Reporter:
    Freddy Mallet
Vote (15)
Watch (8)

Dates

  • Created:
    27/Mar/08 3:32 AM
    Updated:
    10/Jan/12 3:13 PM
    Resolved:
    23/Feb/09 4:33 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.