You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Hugues Pisapia <hu...@labarben.org> on 2007/04/27 13:40:53 UTC

Re: How to put cobertura.ser in target DIR

Hi There,

I've had the antrun plugin does thi for me by adding this the parent
pom of my multi project:

          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <phase>process-test-resources</phase>
                <id>cobertura:bugfix</id>
                <configuration>
                  <tasks>
                    <copy file="${basedir}/target/cobertura/cobertura.ser"
                          todir="${basedir}/"
                          overwrite="true" failonerror="false"/>
                  </tasks>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

And it seems to fix the stuff with sirefire 2.3 and cobertura 2.1.

- Hugues


2007/1/8, Hans L'Hoest <hl...@gmail.com>:
> Hello all,
>
> I seem to be running into the same problem: I can't configure the
> cobertura datafile.
>
> When running cobertura:cobertura I am getting:
>
> "Cobertura: Coverage data file C:\projects\myproject\cobertura.ser
> either does not exist or is not readable.  Creating a new data file."
>
> Followed by lines like:
>
> "[cobertura] INFO  [main]
> net.sourceforge.cobertura.reporting.html.HTMLReport - Data file does
> not contain instrumentation information for the file
> MethodEditor.java.  Ensure this class was instrumented, and this data
> file contains the instrumentation information."
>
> It seems the instrumentation is saved to a different ser file than the
> one that is being used by the report generation. (The instrument goal
> instruments more classes than on the 2nd run with the cobertura goal.)
>
> I can get it to work with a manual step:
> * First run: mvn clean cobertura:instrument
> * Then I copy the cobertura.ser file from
> C:\projects\myproject\target\cobertura to C:\projects\myproject
> * I run mvn cobertura:cobertura
>
> My report is generated fine. No errors.
>
> Any idea how I can fix this (this has nothing to do with the clean
> goal it seems as the correct file cannot be found.)?
>
> Thank you,
> Kind regards,
>
> Hans
>
>
>
> On 10/4/06, Joakim Erdfelt <jo...@erdfelt.com> wrote:
> > Hi,
> >
> > The situation with the dataFile parameter, is that it is unreliable to
> > use System Properties from within the embedded nature of the
> > cobertura-maven-plugin.
> >
> > The bug has a fix on the cobertura side:
> > https://sourceforge.net/tracker/index.php?func=detail&aid=1543280&group_id=130558&atid=720017
> >
> > Go encourage the cobertura folks to commit that patch.
> > Full disclosure: Yes I wrote that patch, so I'm a little biased. ;-)
> >
> > The current cobertura-maven-plugin snapshot available in subversion
> > already supports that cobertura patch.
> >
> > Once that patch is applied on the cobertura side, we should be able to
> > reliably set the dataFile parameter. yay!
> >
> > You can also use the maven-clean-plugin to clean out that file.
> >
> > <plugin>
> >   <groupId>org.apache.maven.plugins</groupId>
> >   <artifactId>maven-clean-plugin</artifactId>
> >   <configuration>
> >     <filesets>
> >       <fileset>
> >         <directory>${basedir}</directory>
> >         <includes>
> >           <include>cobertura.ser</include>
> >         </includes>
> >       </fileset>
> >     </filesets>
> >   </configuration>
> > </plugin>
> >
> > (caution, I wrote this out from memory, it might contain typos.)
> >
> > - Joakim Erdfelt
> >
> > dan tran wrote:
> > > oopps, the doc did say we can not change this location due to bug in
> > > corbertura 1.6
> > >
> > > how about remove that file in your post-clean phase
> > >
> > > -D
> > >
> > >
> > > On 10/4/06, Mick Knutson <mi...@gmail.com> wrote:
> > >>
> > >> So how would I configure dataFile  in my plugin?
> > >>
> > >>
> > >>
> > >>
> > >> On 10/4/06, dan tran <da...@gmail.com> wrote:
> > >> >
> > >> > http://mojo.codehaus.org/cobertura-maven-plugin/cobertura-mojo.html
> > >> >
> > >> > On 10/4/06, Mick Knutson <mi...@gmail.com> wrote:
> > >> > >
> > >> > > I want to know how I can put cobertura.ser into my target DIR so
> > >> when
> > >> I
> > >> > > run
> > >> > > mvn clean, the cobertura files get cleaned as well.
> > >> > >
> > >> > > --
> > >> > >
> >
> >
> > ---------------------------------------------------------------------
> > 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
>
>


-- 
Hugues
----------
e: hugues@labarben.org
jid: huguespisapia@im.apinc.org
Fight Multiple Sclerosis - http://odyssee-espoir.com

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