You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ole Laurisch <la...@engram.de> on 2008/10/06 13:57:19 UTC

Cobertura check fails on deleted classes

Hello,

I'm using Cobertura for code coverage checks. Therefore I have the 
following paragraph in my pom.xml:

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>clean</goal>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <check>
            <branchRate>20</branchRate>
            <lineRate>20</lineRate>
          </check>
          <maxmem>128m</maxmem>
        </configuration>
      </plugin>

Now I have a class "Foo.class" that has no test coverage. Therefore the 
coverage check, executed by running "mvn verify", fails. After deleting 
the class "Foo" and rerunning "mvn verify" the coverage check stills fails 
because the class "Foo.class" is still available in the folder 
"target/generated-classes/cobertura/". 
Is there a way to update this folder before every run without having to 
clean the whole target folder by running "mvn clean"?

Thanks in advance,
Ole

--  
engram GmbH 
Konsul-Smidt-Stra�e 8r 
28217 Bremen 
Germany 
Tel.: +49-[0]421-620298-0 
Fax: +49-[0]421-620298-999 
Handelsregister Bremen HRB 20782 
Gesch�ftsf�hrer: Jens W�nderlich 
Aufsichtsratsvorsitzender: Ralf Paslack 

Re: Cobertura check fails on deleted classes

Posted by Brett Porter <br...@gmail.com>.
It seems cobertura:clean should do that as well - that would be an
enhancement request to make in it's issue tracker.

The way you can achieve it for now is to bind the clean plugin into
the lifecycle to delete only that directory on every build. However,
this will slow things down - it would seem to make more sense to clean
when you need to clean (which is the case for all of the classes).

- Brett

2008/10/6 Ole Laurisch <la...@engram.de>:
> Hello,
>
> I'm using Cobertura for code coverage checks. Therefore I have the
> following paragraph in my pom.xml:
>
>      <plugin>
>        <groupId>org.codehaus.mojo</groupId>
>        <artifactId>cobertura-maven-plugin</artifactId>
>        <executions>
>          <execution>
>            <goals>
>              <goal>clean</goal>
>              <goal>check</goal>
>            </goals>
>          </execution>
>        </executions>
>        <configuration>
>          <check>
>            <branchRate>20</branchRate>
>            <lineRate>20</lineRate>
>          </check>
>          <maxmem>128m</maxmem>
>        </configuration>
>      </plugin>
>
> Now I have a class "Foo.class" that has no test coverage. Therefore the
> coverage check, executed by running "mvn verify", fails. After deleting
> the class "Foo" and rerunning "mvn verify" the coverage check stills fails
> because the class "Foo.class" is still available in the folder
> "target/generated-classes/cobertura/".
> Is there a way to update this folder before every run without having to
> clean the whole target folder by running "mvn clean"?
>
> Thanks in advance,
> Ole
>
> --
> engram GmbH
> Konsul-Smidt-Straße 8r
> 28217 Bremen
> Germany
> Tel.: +49-[0]421-620298-0
> Fax: +49-[0]421-620298-999
> Handelsregister Bremen HRB 20782
> Geschäftsführer: Jens Wünderlich
> Aufsichtsratsvorsitzender: Ralf Paslack
>



-- 
Brett Porter
Blog: http://blogs.exist.com/bporter/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Problem with release plugin

Posted by Samuli Saarinen <sa...@remion.com>.
Ok, I found the issue http://jira.codehaus.org/browse/MRELEASE-295

Brett Porter wrote:
> That sounds like a bug. It is generally uncommon to use the release
> plugin to simultaneously release projects of different versions, but
> it should work.
> 
> - Brett
> 
> 2008/10/7 Samuli Saarinen <sa...@remion.com>:
>> Hello,
>>
>> I'm using maven 2.0.9 with a multi-module project and try to make a release
>> using maven-release-plugin. My project structure is following:
>>
>> parent
>>  - child1
>>  - child2
>>
>> parent pom.xml:
>> <project>
>> ...
>>  <version>1.0.2-SNAPSHOT</version>
>>  <modules>
>>        <module>child1</module>
>>        <module>child2</module>
>>  </modules>
>> ...
>> </project>
>>
>> child1 pom.xml:
>> <project>
>> ...
>>        <version>1.0.3-SNAPSHOT</version>
>>        <parent>
>>                <groupId>com.foo.test</groupId>
>>                <artifactId>test</artifactId>
>>                <version>1.0.2-SNAPSHOT</version>
>>        </parent>
>> ...
>> </project>
>>
>> child2 pom.xml:
>> <project>
>> ...
>>        <version>1.0.2-SNAPSHOT</version>
>>        <parent>
>>                <groupId>com.foo.test</groupId>
>>                <artifactId>test</artifactId>
>>                <version>1.0.2-SNAPSHOT</version>
>>        </parent>
>>
>>        <dependencies>
>>                <dependency>
>>                        <groupId>${project.groupId}</groupId>
>>                        <artifactId>child1</artifactId>
>>                        <version>1.0.3-SNAPSHOT</version>
>>                </dependency>
>>        </dependencies>
>> ...
>> </project>
>>
>>
>> after I prepare a release the pom.xml.tag for child2 has dependency to 1.0.3
>> version of child1 as expected but pom.xml.next for child2 contains
>> dependency to 1.0.3-SNAPSHOT of child1 although the next development version
>> for child1 is specified as 1.0.4-SNAPSHOT.
>>
>> Is this the intended behaviour or a bug?
>>
>> Thanks in advance,
>>
>> Samuli
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Problem with release plugin

Posted by Brett Porter <br...@gmail.com>.
That sounds like a bug. It is generally uncommon to use the release
plugin to simultaneously release projects of different versions, but
it should work.

- Brett

2008/10/7 Samuli Saarinen <sa...@remion.com>:
> Hello,
>
> I'm using maven 2.0.9 with a multi-module project and try to make a release
> using maven-release-plugin. My project structure is following:
>
> parent
>  - child1
>  - child2
>
> parent pom.xml:
> <project>
> ...
>  <version>1.0.2-SNAPSHOT</version>
>  <modules>
>        <module>child1</module>
>        <module>child2</module>
>  </modules>
> ...
> </project>
>
> child1 pom.xml:
> <project>
> ...
>        <version>1.0.3-SNAPSHOT</version>
>        <parent>
>                <groupId>com.foo.test</groupId>
>                <artifactId>test</artifactId>
>                <version>1.0.2-SNAPSHOT</version>
>        </parent>
> ...
> </project>
>
> child2 pom.xml:
> <project>
> ...
>        <version>1.0.2-SNAPSHOT</version>
>        <parent>
>                <groupId>com.foo.test</groupId>
>                <artifactId>test</artifactId>
>                <version>1.0.2-SNAPSHOT</version>
>        </parent>
>
>        <dependencies>
>                <dependency>
>                        <groupId>${project.groupId}</groupId>
>                        <artifactId>child1</artifactId>
>                        <version>1.0.3-SNAPSHOT</version>
>                </dependency>
>        </dependencies>
> ...
> </project>
>
>
> after I prepare a release the pom.xml.tag for child2 has dependency to 1.0.3
> version of child1 as expected but pom.xml.next for child2 contains
> dependency to 1.0.3-SNAPSHOT of child1 although the next development version
> for child1 is specified as 1.0.4-SNAPSHOT.
>
> Is this the intended behaviour or a bug?
>
> Thanks in advance,
>
> Samuli
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>



-- 
Brett Porter
Blog: http://blogs.exist.com/bporter/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Problem with release plugin

Posted by "L. J." <ap...@gmail.com>.
during release:prepare, the plugin should prompt you for the next SNAPSHOT
version of your child2, that's where you can change the version number.


On Mon, Oct 6, 2008 at 6:00 AM, Samuli Saarinen
<sa...@remion.com>wrote:

> Hello,
>
> I'm using maven 2.0.9 with a multi-module project and try to make a release
> using maven-release-plugin. My project structure is following:
>
> parent
>  - child1
>  - child2
>
> parent pom.xml:
> <project>
> ...
>  <version>1.0.2-SNAPSHOT</version>
>  <modules>
>        <module>child1</module>
>        <module>child2</module>
>  </modules>
> ...
> </project>
>
> child1 pom.xml:
> <project>
> ...
>        <version>1.0.3-SNAPSHOT</version>
>        <parent>
>                <groupId>com.foo.test</groupId>
>                <artifactId>test</artifactId>
>                <version>1.0.2-SNAPSHOT</version>
>        </parent>
> ...
> </project>
>
> child2 pom.xml:
> <project>
> ...
>        <version>1.0.2-SNAPSHOT</version>
>        <parent>
>                <groupId>com.foo.test</groupId>
>                <artifactId>test</artifactId>
>                <version>1.0.2-SNAPSHOT</version>
>        </parent>
>
>        <dependencies>
>                <dependency>
>                        <groupId>${project.groupId}</groupId>
>                        <artifactId>child1</artifactId>
>                        <version>1.0.3-SNAPSHOT</version>
>                </dependency>
>        </dependencies>
> ...
> </project>
>
>
> after I prepare a release the pom.xml.tag for child2 has dependency to
> 1.0.3 version of child1 as expected but pom.xml.next for child2 contains
> dependency to 1.0.3-SNAPSHOT of child1 although the next development version
> for child1 is specified as 1.0.4-SNAPSHOT.
>
> Is this the intended behaviour or a bug?
>
> Thanks in advance,
>
> Samuli
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Problem with release plugin

Posted by Samuli Saarinen <sa...@remion.com>.
Hello,

I'm using maven 2.0.9 with a multi-module project and try to make a 
release using maven-release-plugin. My project structure is following:

parent
   - child1
   - child2

parent pom.xml:
<project>
...
   <version>1.0.2-SNAPSHOT</version>
   <modules>
   	<module>child1</module>
   	<module>child2</module>
   </modules>
...
</project>

child1 pom.xml:
<project>
...
	<version>1.0.3-SNAPSHOT</version>
	<parent>
		<groupId>com.foo.test</groupId>
		<artifactId>test</artifactId>
		<version>1.0.2-SNAPSHOT</version>
	</parent>
...
</project>

child2 pom.xml:
<project>
...
	<version>1.0.2-SNAPSHOT</version>
	<parent>
		<groupId>com.foo.test</groupId>
		<artifactId>test</artifactId>
		<version>1.0.2-SNAPSHOT</version>
   	</parent>

	<dependencies>
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>child1</artifactId>
			<version>1.0.3-SNAPSHOT</version>
		</dependency>
	</dependencies>
...
</project>


after I prepare a release the pom.xml.tag for child2 has dependency to 
1.0.3 version of child1 as expected but pom.xml.next for child2 contains 
dependency to 1.0.3-SNAPSHOT of child1 although the next development 
version for child1 is specified as 1.0.4-SNAPSHOT.

Is this the intended behaviour or a bug?

Thanks in advance,

Samuli

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org