You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Vincent Massol <vm...@pivolis.com> on 2005/10/25 16:31:45 UTC

[m2] Clover plugin issue with latest install plugin

Hi there,

The Clover plugin forks a custom lifecycle when executing either the
clover:check or clover:clover mojo. Let's take the clover:check mojo as an
example:

@phase verify
@execute phase="test" lifecycle="clover"

Thus, if the user calls "mvn install" on a project where the clover:check
mojo is defined in the pom.xml my understanding is:

- the main lifeycle is going to be triggered
- once it reaches the verify phase it's going to start the clover lifecycle
- the clover lifecycle is going to run all the phases again till the test
phase
- after the clover lifecycle finishes the main lifecycle continues

Is that correct?

The problem I have is that I get the following error:

[INFO] [install:install]
[INFO] Installing
C:\dev\maven\components\trunk\examples\maven-clover-plugin-samples\maven-clo
ver-plugin-sample-simple\target\clover\classes to C:\Documents and
Settings\Vincent
Massol\.m2\repository\org\apache\maven\plugins\maven-clover-plugin-sample-si
mple\1.0-SNAPSHOT\maven-clover-plugin-sample-simple-1.0-SNAPSHOT.jar

As you can see the install plugin is not pointing to the correct artifact.
It's pointing to the target/clover/classes directory instead of pointing to
target/maven-clover-plugin-sample-simple-1.0-SNAPSHOT.jar

I believe this is because the clover plugin modifies some Project settings.
However I would have thought that the spawned lifecycle would also clone the
Project so that when it returns the original Project is left untouched.

For information, here's what is modified in the clover mojo:

this.project.getCompileSourceRoots().remove( 0 );
this.project.addCompileSourceRoot( this.cloverOutputSourceDirectory );

this.project.setDependencyArtifacts( ... );

// Explicitely set the output directory to be the Clover one so that all 
// other plugins executing thereafter output files in the Clover output 
// directory and not in the main output directory.
// TODO: Ulgy hack below. Changing the directory should be enough for 
// changing the values of all other properties depending on it!
this.project.getBuild().setDirectory( this.cloverOutputDirectory );
this.project.getBuild().setOutputDirectory( 
    new File( this.cloverOutputDirectory, "classes" ).getPath() );
this.project.getBuild().setTestOutputDirectory(
    new File( this.cloverOutputDirectory, "test-classes" ).getPath() );

Any idea?

Thanks
-Vincent


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


RE: [m2] Clover plugin issue with latest install plugin

Posted by Vincent Massol <vm...@pivolis.com>.

> -----Original Message-----
> From: Vincent Massol [mailto:vmassol@pivolis.com]
> Sent: jeudi 27 octobre 2005 01:31
> To: 'Maven Developers List'
> Subject: RE: [m2] Clover plugin issue with latest install plugin
> 
> 
> 
> > -----Original Message-----
> > From: Brett Porter [mailto:brett@apache.org]
> > Sent: mercredi 26 octobre 2005 07:46
> > To: Maven Developers List
> > Subject: Re: [m2] Clover plugin issue with latest install plugin
> >
> > It is supposed to clone the lifecycle, and the clover plugin used to
> > work. Bug?
> 
> Looks like a bug to me but I haven't tracked it down. Actually I don't
> even
> know if I have enough core knowledge to track it... Help would be welcome
> here. That's the only little detail that remains before being able to
> release the Clover plugin! (the doc is still not finished but I can do
> that
> very quickly).

I think Kenney has found the problem:

Line 189 in MavenProject.java, someone wrote:

        // TODO: need to clone this too?
        this.artifact = project.artifact;

The answer is: yes! :-)

Opened JIRA issue: http://jira.codehaus.org/browse/MNG-1335

[snip]

Thanks
-Vincent


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


RE: [m2] Clover plugin issue with latest install plugin

Posted by Vincent Massol <vm...@pivolis.com>.

> -----Original Message-----
> From: Brett Porter [mailto:brett@apache.org]
> Sent: mercredi 26 octobre 2005 07:46
> To: Maven Developers List
> Subject: Re: [m2] Clover plugin issue with latest install plugin
> 
> It is supposed to clone the lifecycle, and the clover plugin used to
> work. Bug?

Looks like a bug to me but I haven't tracked it down. Actually I don't even
know if I have enough core knowledge to track it... Help would be welcome
here. That's the only little detail that remains before being able to
release the Clover plugin! (the doc is still not finished but I can do that
very quickly).

Thanks
-Vincent
 
> Vincent Massol wrote:
> > Hi there,
> >
> > The Clover plugin forks a custom lifecycle when executing either the
> > clover:check or clover:clover mojo. Let's take the clover:check mojo as
> an
> > example:
> >
> > @phase verify
> > @execute phase="test" lifecycle="clover"
> >
> > Thus, if the user calls "mvn install" on a project where the
> clover:check
> > mojo is defined in the pom.xml my understanding is:
> >
> > - the main lifeycle is going to be triggered
> > - once it reaches the verify phase it's going to start the clover
> lifecycle
> > - the clover lifecycle is going to run all the phases again till the
> test
> > phase
> > - after the clover lifecycle finishes the main lifecycle continues
> >
> > Is that correct?
> >
> > The problem I have is that I get the following error:
> >
> > [INFO] [install:install]
> > [INFO] Installing
> > C:\dev\maven\components\trunk\examples\maven-clover-plugin-
> samples\maven-clo
> > ver-plugin-sample-simple\target\clover\classes to C:\Documents and
> > Settings\Vincent
> > Massol\.m2\repository\org\apache\maven\plugins\maven-clover-plugin-
> sample-si
> > mple\1.0-SNAPSHOT\maven-clover-plugin-sample-simple-1.0-SNAPSHOT.jar
> >
> > As you can see the install plugin is not pointing to the correct
> artifact.
> > It's pointing to the target/clover/classes directory instead of pointing
> to
> > target/maven-clover-plugin-sample-simple-1.0-SNAPSHOT.jar
> >
> > I believe this is because the clover plugin modifies some Project
> settings.
> > However I would have thought that the spawned lifecycle would also clone
> the
> > Project so that when it returns the original Project is left untouched.
> >
> > For information, here's what is modified in the clover mojo:
> >
> > this.project.getCompileSourceRoots().remove( 0 );
> > this.project.addCompileSourceRoot( this.cloverOutputSourceDirectory );
> >
> > this.project.setDependencyArtifacts( ... );
> >
> > // Explicitely set the output directory to be the Clover one so that all
> > // other plugins executing thereafter output files in the Clover output
> > // directory and not in the main output directory.
> > // TODO: Ulgy hack below. Changing the directory should be enough for
> > // changing the values of all other properties depending on it!
> > this.project.getBuild().setDirectory( this.cloverOutputDirectory );
> > this.project.getBuild().setOutputDirectory(
> >     new File( this.cloverOutputDirectory, "classes" ).getPath() );
> > this.project.getBuild().setTestOutputDirectory(
> >     new File( this.cloverOutputDirectory, "test-classes" ).getPath() );
> >
> > Any idea?
> >
> > Thanks
> > -Vincent
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org



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


Re: [m2] Clover plugin issue with latest install plugin

Posted by Brett Porter <br...@apache.org>.
It is supposed to clone the lifecycle, and the clover plugin used to 
work. Bug?

- Brett

Vincent Massol wrote:
> Hi there,
> 
> The Clover plugin forks a custom lifecycle when executing either the
> clover:check or clover:clover mojo. Let's take the clover:check mojo as an
> example:
> 
> @phase verify
> @execute phase="test" lifecycle="clover"
> 
> Thus, if the user calls "mvn install" on a project where the clover:check
> mojo is defined in the pom.xml my understanding is:
> 
> - the main lifeycle is going to be triggered
> - once it reaches the verify phase it's going to start the clover lifecycle
> - the clover lifecycle is going to run all the phases again till the test
> phase
> - after the clover lifecycle finishes the main lifecycle continues
> 
> Is that correct?
> 
> The problem I have is that I get the following error:
> 
> [INFO] [install:install]
> [INFO] Installing
> C:\dev\maven\components\trunk\examples\maven-clover-plugin-samples\maven-clo
> ver-plugin-sample-simple\target\clover\classes to C:\Documents and
> Settings\Vincent
> Massol\.m2\repository\org\apache\maven\plugins\maven-clover-plugin-sample-si
> mple\1.0-SNAPSHOT\maven-clover-plugin-sample-simple-1.0-SNAPSHOT.jar
> 
> As you can see the install plugin is not pointing to the correct artifact.
> It's pointing to the target/clover/classes directory instead of pointing to
> target/maven-clover-plugin-sample-simple-1.0-SNAPSHOT.jar
> 
> I believe this is because the clover plugin modifies some Project settings.
> However I would have thought that the spawned lifecycle would also clone the
> Project so that when it returns the original Project is left untouched.
> 
> For information, here's what is modified in the clover mojo:
> 
> this.project.getCompileSourceRoots().remove( 0 );
> this.project.addCompileSourceRoot( this.cloverOutputSourceDirectory );
> 
> this.project.setDependencyArtifacts( ... );
> 
> // Explicitely set the output directory to be the Clover one so that all 
> // other plugins executing thereafter output files in the Clover output 
> // directory and not in the main output directory.
> // TODO: Ulgy hack below. Changing the directory should be enough for 
> // changing the values of all other properties depending on it!
> this.project.getBuild().setDirectory( this.cloverOutputDirectory );
> this.project.getBuild().setOutputDirectory( 
>     new File( this.cloverOutputDirectory, "classes" ).getPath() );
> this.project.getBuild().setTestOutputDirectory(
>     new File( this.cloverOutputDirectory, "test-classes" ).getPath() );
> 
> Any idea?
> 
> Thanks
> -Vincent
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 


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