You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Benjamin Bentmann <be...@udo.edu> on 2009/08/02 13:53:32 UTC

Re: svn commit: r800032 - in /maven/plugins/trunk/maven-linkcheck-plugin: pom.xml src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReport.java

Hi Vincent,

> Author: vsiveton
> Date: Sun Aug  2 11:24:25 2009
> New Revision: 800032
> 
> URL: http://svn.apache.org/viewvc?rev=800032&view=rev
> Log:
> o using maven 2.0.9

This also requires to bump the <prerequsites> on Maven, e.g. older Maven 
versions don't support MavenProject.clone() and will die with a linkage 
error upon executing the mojo.

>              catch ( IOException e )
>              {
> -                getLog().debug( "IOException: " + e.getMessage(), e );
> +                String msg = "IOException: " + e.getMessage();
> +                if ( getLog().isDebugEnabled() )
> +                {
> +                    getLog().debug( msg, e );
> +                }
> +                else
> +                {
> +                    getLog().error( msg );
> +                }

Consider to output the error message at error level in both cases. I 
mean the severity of the message remains the same whether the plugin 
additionally dumps the stack trace or not. Somebody who greps the log 
output for ERROR would otherwise miss this information when debug 
logging was enabled.

> +        clone.getOriginalModel().getReporting().setOutputDirectory( tmpReportingOutputDirectory.getAbsolutePath() );

Hm, maybe you could solve this without a temp model and simplify the 
code: I see the Site Plugin's outputDirectory parameter can be 
configured via the system property siteOutputDirectory. Adding this to 
the forked invocation should do equally well, shouldn't it?


Benjamin

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


Re: svn commit: r800032 - in /maven/plugins/trunk/maven-linkcheck-plugin: pom.xml src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReport.java

Posted by Benjamin Bentmann <be...@udo.edu>.
Hi Vincent,

> Think about plugins which use ${project.reporting.outputDirectory} in
> there conf.

A properly [0] implemented reporting plugin must not use this value 
during the site lifecycle. But you're right, updating the model is more 
robust as it captures the buggy plugins as well.


Benjamin


[0] 
http://maven.apache.org/plugin-developers/common-bugs.html#Determining_the_Output_Directory_for_a_Site_Report

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


Re: svn commit: r800032 - in /maven/plugins/trunk/maven-linkcheck-plugin: pom.xml src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReport.java

Posted by Vincent Siveton <vs...@apache.org>.
Hi Benjamin,

2009/8/2 Benjamin Bentmann <be...@udo.edu>:
> This also requires to bump the <prerequsites> on Maven, e.g. older Maven
> versions don't support MavenProject.clone() and will die with a linkage
> error upon executing the mojo.

Right and it is why I bump to 2.0.9 dep!

> Consider to output the error message at error level in both cases. I mean
> the severity of the message remains the same whether the plugin additionally
> dumps the stack trace or not. Somebody who greps the log output for ERROR
> would otherwise miss this information when debug logging was enabled.

Well make sense.

>
>> +        clone.getOriginalModel().getReporting().setOutputDirectory(
>> tmpReportingOutputDirectory.getAbsolutePath() );
>
> Hm, maybe you could solve this without a temp model and simplify the code: I
> see the Site Plugin's outputDirectory parameter can be configured via the
> system property siteOutputDirectory. Adding this to the forked invocation
> should do equally well, shouldn't it?

Nope, it is why I created a temp pom file and set the reporting output dir.
Think about plugins which use ${project.reporting.outputDirectory} in
there conf.

Cheers

Vincent

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