Problems with exclusions in cobertura-maven-plugin

View: New views
8 Messages — Rating Filter:   Alert me  

Problems with exclusions in cobertura-maven-plugin

by Ulrich Wolf-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello everyone,

i'm trying to exclude several files from the cobertura overview. These files
are containing GUI-code, which doesn't need to be tested.

My directory structure:
|-tld.example.project
|--tld.example.project.database
|--tld.example.project.gui
|---...
|---tld.example.project.gui.configuration
|----tld.example.project.gui.configuration.users
|----...
|--tld.example.project.logic

I'm trying to exclude tld.example.project.gui and all subpackages from
cobertura.

Thus I tried the following pom.xml according to the documentation and a lot
of blogs and forumposts in the web:

<project>
  ...
  <build>
    ...
    <plugins>
      ...
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>2.2</version>
        <configuration>
          <instrumentation>
            <excludes>
              <exclude>tld.example.project.gui.*</exclude>
            </excludes>
            <ignores>
              <ignore>tld/example/project/gui/**/*</ignore>
            </ignores>
          </instrumentation>
        </configuration>
        <executions>
          <execution>
            <id>clean</id>
            <phase>pre-site</phase>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>
          <execution>
            <id>instrument</id>
            <phase>site</phase>
            <goals>
              <goal>instrument</goal>
              <goal>cobertura</goal>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </reporting>
</project>

But this led to the same result as before I added the exclusions and
ignores. To dig to the cause, I switched on the debug-output:

[DEBUG] Setting context classloader for plugin to:
/plugins/org.codehaus.mojo:cobertura-maven-plugin:2.1@48/thread:main
(instance is:
ClassRealm[/plugins/org.codehaus.mojo:cobertura-maven-plugin:2.1@48/thread:m
ain, parent: ClassRealm[plexus.core, parent: null]])
[DEBUG] Config : <ConfigInstrumentation
basedir="C:\Stuff\eclipse\myproject\target\generated-classes\cobertura"
includes="**/*.class" />
[DEBUG] Basedir:
C:\Stuff\eclipse\myproject\target\generated-classes\cobertura
[DEBUG] Include: **/*.class
[DEBUG] Exclude:
**/*~,**/#*#,**/.#*,**/%*%,**/._*,**/CVS,**/CVS/**,**/.cvsignore,**/SCCS,**/
SCCS/**,**/vssver.scc,**/.svn,**/.svn/**,**/.arch-ids,**/.arch-ids/**,**/.DS
_Store

As you can see, nothing from the above rules gets excluded. I don't
understand why? What am I overseeing?

Thank you very much in advance!
Uli


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Problems with exclusions in cobertura-maven-plugin

by Benjamin Bentmann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ulrich Wolf wrote:

> I'm trying to exclude tld.example.project.gui and all subpackages from
> cobertura.

Try moving the <configuration> from the <build> section to the
<reporting> section. As mentioned in [0], a build config does not affect
a reporting plugin execution.


Benjamin


[0] http://maven.apache.org/pom.html#Reporting

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



AW: Problems with exclusions in cobertura-maven-plugin

by Ulrich Wolf-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Benjamin Bentmann wrote:
>
> Try moving the <configuration> from the <build> section to the
> <reporting> section. As mentioned in [0], a build config does not
> affect
> a reporting plugin execution.
>
> Benjamin
>
> [0] http://maven.apache.org/pom.html#Reporting

Thanks for your reply, nice to know that! I thought that it would be the
other way round.

Now I've also tested that, but this doesn't change anything. I also tried
running cobertura separately from "site" as cobertura:cobertura, which
probably should use the <configuration> from the <build>-Section but the
output didn't change.

I also tried to exchange the notation of includes and excludes (dots &
slashes) and defining every sourcefile on its own, but all that didn't help.

Really odd behavior, I can't really see why this is happening...

Uli


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: AW: Problems with exclusions in cobertura-maven-plugin

by Martin777 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Have you solved the problem? I have the same issue with Cobertura, I want to ignore my data classes package. I've tried many combinations of ignore/exclude, but no luck :)

Ulrich Wolf-2 wrote:
Benjamin Bentmann wrote:
>
> Try moving the <configuration> from the <build> section to the
> <reporting> section. As mentioned in [0], a build config does not
> affect
> a reporting plugin execution.
>
> Benjamin
>
> [0] http://maven.apache.org/pom.html#Reporting

Thanks for your reply, nice to know that! I thought that it would be the
other way round.

Now I've also tested that, but this doesn't change anything. I also tried
running cobertura separately from "site" as cobertura:cobertura, which
probably should use the <configuration> from the <build>-Section but the
output didn't change.

I also tried to exchange the notation of includes and excludes (dots &
slashes) and defining every sourcefile on its own, but all that didn't help.

Really odd behavior, I can't really see why this is happening...

Uli


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Re: AW: Problems with exclusions in cobertura-maven-plugin

by Martin777 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've checked the plugin sources available online and it looks to me, that it never uses the ignores or exludes, just includes everything... Could I be right? :)


Have you solved the problem? I have the same issue with Cobertura, I want to ignore my data classes package. I've tried many combinations of ignore/exclude, but no luck :)

Ulrich Wolf-2 wrote:
Benjamin Bentmann wrote:
>
> Try moving the <configuration> from the <build> section to the
> <reporting> section. As mentioned in [0], a build config does not
> affect
> a reporting plugin execution.
>
> Benjamin
>
> [0] http://maven.apache.org/pom.html#Reporting

Thanks for your reply, nice to know that! I thought that it would be the
other way round.

Now I've also tested that, but this doesn't change anything. I also tried
running cobertura separately from "site" as cobertura:cobertura, which
probably should use the <configuration> from the <build>-Section but the
output didn't change.

I also tried to exchange the notation of includes and excludes (dots &
slashes) and defining every sourcefile on its own, but all that didn't help.

Really odd behavior, I can't really see why this is happening...

Uli


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: AW: Problems with exclusions in cobertura-maven-plugin

by Martin777 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry, I was wrong, the configuration is loaded correctly, I see the includes, ignores and excludes, but it seems like the ignores have no effect. Now I am confused.



I've checked the plugin sources available online and it looks to me, that it never uses the ignores or exludes, just includes everything... Could I be right? :)

Martin777 wrote:
Have you solved the problem? I have the same issue with Cobertura, I want to ignore my data classes package. I've tried many combinations of ignore/exclude, but no luck :)

Ulrich Wolf-2 wrote:
Benjamin Bentmann wrote:
>
> Try moving the <configuration> from the <build> section to the
> <reporting> section. As mentioned in [0], a build config does not
> affect
> a reporting plugin execution.
>
> Benjamin
>
> [0] http://maven.apache.org/pom.html#Reporting

Thanks for your reply, nice to know that! I thought that it would be the
other way round.

Now I've also tested that, but this doesn't change anything. I also tried
running cobertura separately from "site" as cobertura:cobertura, which
probably should use the <configuration> from the <build>-Section but the
output didn't change.

I also tried to exchange the notation of includes and excludes (dots &
slashes) and defining every sourcefile on its own, but all that didn't help.

Really odd behavior, I can't really see why this is happening...

Uli


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


AW: AW: Problems with exclusions in cobertura-maven-plugin

by Ulrich Wolf-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You are right, this problem was never solved...

Still looking for a solution, but haven't found one yet.

Uli

-----Ursprüngliche Nachricht-----
Von: Martin777 [mailto:martin.varga@...]
Gesendet: Dienstag, 2. Juni 2009 14:06
An: user@...
Betreff: Re: AW: [mojo-user] Problems with exclusions in
cobertura-maven-plugin


I've checked the plugin sources available online and it looks to me, that it
never uses the ignores or exludes, just includes everything... Could I be
right? :)


Martin777 wrote:

>
> Have you solved the problem? I have the same issue with Cobertura, I want
> to ignore my data classes package. I've tried many combinations of
> ignore/exclude, but no luck :)
>
>
> Ulrich Wolf-2 wrote:
>>
>> Benjamin Bentmann wrote:
>>>
>>> Try moving the <configuration> from the <build> section to the
>>> <reporting> section. As mentioned in [0], a build config does not
>>> affect
>>> a reporting plugin execution.
>>>
>>> Benjamin
>>>
>>> [0] http://maven.apache.org/pom.html#Reporting
>>
>> Thanks for your reply, nice to know that! I thought that it would be the
>> other way round.
>>
>> Now I've also tested that, but this doesn't change anything. I also tried
>> running cobertura separately from "site" as cobertura:cobertura, which
>> probably should use the <configuration> from the <build>-Section but the
>> output didn't change.
>>
>> I also tried to exchange the notation of includes and excludes (dots &
>> slashes) and defining every sourcefile on its own, but all that didn't
>> help.
>>
>> Really odd behavior, I can't really see why this is happening...
>>
>> Uli
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>
>>
>
>

--
View this message in context:
http://www.nabble.com/Problems-with-exclusions-in-cobertura-maven-plugin-tp2
3011559p23831281.html
Sent from the mojo - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: AW: Problems with exclusions in cobertura-maven-plugin

by Grzegorz Słowikowski :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I followed the instructions here:
and it works.

My configuration:
<reporting>
  <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <configuration>
          <instrumentation>
            <ignores>
              <ignore>my.package.to.ignore.*</ignore>
            </ignores>
            <excludes>
              <exclude>my/package/to/ignore/*.class</exclude>
            </excludes>
          </instrumentation>
        </configuration>
      </plugin>
  </plugins>
</reporting>

The "ignores" must contain dots, and the "excludes" - slashes.

Greetings to all.

Grzegorz Slowikowski


2009/6/2 Ulrich Wolf <m@...>
You are right, this problem was never solved...

Still looking for a solution, but haven't found one yet.

Uli

-----Ursprüngliche Nachricht-----
Von: Martin777 [mailto:martin.varga@...]
Gesendet: Dienstag, 2. Juni 2009 14:06
An: user@...
Betreff: Re: AW: [mojo-user] Problems with exclusions in
cobertura-maven-plugin


I've checked the plugin sources available online and it looks to me, that it
never uses the ignores or exludes, just includes everything... Could I be
right? :)


Martin777 wrote:
>
> Have you solved the problem? I have the same issue with Cobertura, I want
> to ignore my data classes package. I've tried many combinations of
> ignore/exclude, but no luck :)
>
>
> Ulrich Wolf-2 wrote:
>>
>> Benjamin Bentmann wrote:
>>>
>>> Try moving the <configuration> from the <build> section to the
>>> <reporting> section. As mentioned in [0], a build config does not
>>> affect
>>> a reporting plugin execution.
>>>
>>> Benjamin
>>>
>>> [0] http://maven.apache.org/pom.html#Reporting
>>
>> Thanks for your reply, nice to know that! I thought that it would be the
>> other way round.
>>
>> Now I've also tested that, but this doesn't change anything. I also tried
>> running cobertura separately from "site" as cobertura:cobertura, which
>> probably should use the <configuration> from the <build>-Section but the
>> output didn't change.
>>
>> I also tried to exchange the notation of includes and excludes (dots &
>> slashes) and defining every sourcefile on its own, but all that didn't
>> help.
>>
>> Really odd behavior, I can't really see why this is happening...
>>
>> Uli
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>
>>
>
>

--
View this message in context:
http://www.nabble.com/Problems-with-exclusions-in-cobertura-maven-plugin-tp2
3011559p23831281.html

Sent from the mojo - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email