maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukas Theussl <ltheu...@apache.org>
Subject Re: svn commit: r1059551 - /maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java
Date Sun, 16 Jan 2011 13:52:59 GMT


Benjamin Bentmann wrote:
> Hi Lukaus,
>
>> Author: ltheussl
>> Date: Sun Jan 16 13:14:04 2011
>> New Revision: 1059551
>>
>> URL: http://svn.apache.org/viewvc?rev=1059551&view=rev
>> Log:
>> [MPLUGIN-180] forward encoding to the PluginToolsRequest
>>
>> Modified:
>> maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java
>>
>>
>> Modified:
>> maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java
>>
>> URL:
>> http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java?rev=1059551&r1=1059550&r2=1059551&view=diff
>>
>> ==============================================================================
>>
>> ---
>> maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java
>> (original)
>> +++
>> maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java
>> Sun Jan 16 13:14:04 2011
>> @@ -91,6 +91,13 @@ public class PluginReport
>> */
>> protected MojoScanner mojoScanner;
>>
>> + /**
>> + * @parameter expression="${outputEncoding}"
>> default-value="${project.reporting.outputEncoding}"
>> + * @since 2.7
>> + */
>> + private String outputEncoding;
>> +
>> +
>> /**
>> * Specify some requirements to execute this plugin.
>> * Example:
>> @@ -183,6 +190,7 @@ public class PluginReport
>> pluginDescriptor.setDependencies( PluginUtils.toComponentDependencies(
>> project.getRuntimeDependencies() ) );
>>
>> PluginToolsRequest request = new DefaultPluginToolsRequest( project,
>> pluginDescriptor );
>> + request.setEncoding( outputEncoding );
>>
>> mojoScanner.populatePluginDescriptor( request );
>
> This is wrong, you confuse the source input encoding with the report
> output encoding. From the javadoc of PluginToolsRequest.setEncoding():
>
> "Sets the file encoding of the source files."
>
> The proper fix should be to align the report mojo with the other mojos
> and use
>
> /**
> * The file encoding of the source files.
> *
> * @parameter expression="${encoding}"
> default-value="${project.build.sourceEncoding}"
> * @since 2.7
> */
> protected String encoding;
>
> as the encoding parameter for the request.

I am confused indeed. I simply used MPLUGIN-180 to verify it works, but 
just realized it's not good because both input and output encoding are 
the same there.

However, the problem is not that the generated report has the wrong 
encoding, rather the generated, intermediate xdoc, from which the report 
is generated (run 'mvn site:site' and 'mvn plugin:xdoc' on the attached 
test project and compare the generated xdoc). For writing this, I would 
have thought one should use the outputEncoding parameter? Tell me if I'm 
wrong and I'll change it.

Thanks for looking!
-Lukas


>
> The output encoding for the docs is handled by the Site Plugin AFAIK,
> isn't it?
>
>
> Benjamin
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message