Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 454537

Summary: [tycho-document-bundle-plugin] make encoding of javadoc call customizable
Product: z_Archived Reporter: Christian Dietrich <christian.dietrich.opensource>
Component: TychoAssignee: Martin Schreiber <Martin.SCHREIBER>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: jan.sievers, Martin.SCHREIBER
Version: unspecifiedKeywords: helpwanted
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Christian Dietrich CLA 2014-12-09 04:32:05 EST
The JavaDoc Options of tycho-document-bundle-plugin should add a possibility to specify the source file encoding. the value should default to project.build.sourceEncoding and be passed to the javadoc call.
(basically the very same as in maven-javadoc-plugin)
Comment 1 Jan Sievers CLA 2014-12-09 04:52:42 EST
I wonder if this is not already possible using 


https://www.eclipse.org/tycho/sitedocs-extras/tycho-document-bundle-plugin/javadoc-mojo.html#javadocOptions

<plugin>
 <groupId>org.eclipse.tycho.extras</groupId>
 <artifactId>tycho-document-bundle-plugin</artifactId>
 <version>0.22.0</version>
 <configuration>
  <javadocOptions>
    <additionalArguments>
       <arg>whatever_javadoc_argument_goes_here</arg>
    </additionalArguments>
  </javadocOptions>
 </configuration>
</plugin>
Comment 2 Christian Dietrich CLA 2014-12-09 04:54:10 EST
yes it is (thus an enhancement) but you have to do it manually. it should pick up the default encoding out of the box
Comment 3 Martin Schreiber CLA 2014-12-23 00:59:47 EST
(In reply to Christian Dietrich from comment #2)
> yes it is (thus an enhancement) but you have to do it manually. it should
> pick up the default encoding out of the box

The maven java doc plugin is using the ${project.reporting.outputEncoding} as default [1]. Should we use that as default or the source file encoding?


[1] http://maven.apache.org/plugins/maven-javadoc-plugin/javadoc-mojo.html#docencoding
Comment 4 Christian Dietrich CLA 2014-12-23 04:23:45 EST
my problem actually was that the build ran under windows (no encoding set) and the source was actually UTF-8. the the java(doc) parser of the javadoc command failed since it stumbeld over some bad characters. thus i think it should be the source encoding if i read http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#encoding right. for the output encoding there is http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#docencoding
Comment 5 Martin Schreiber CLA 2014-12-23 04:40:47 EST
(In reply to Christian Dietrich from comment #4)
> my problem actually was that the build ran under windows (no encoding set)
> and the source was actually UTF-8. the the java(doc) parser of the javadoc
> command failed since it stumbeld over some bad characters. thus i think it
> should be the source encoding if i read
> http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.
> html#encoding right. for the output encoding there is
> http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.
> html#docencoding

Sorry, I messed up docencoding and encoding.
Comment 6 Jan Sievers CLA 2015-01-07 03:28:59 EST
(In reply to Martin Schreiber from comment #3)
> (In reply to Christian Dietrich from comment #2)
> > yes it is (thus an enhancement) but you have to do it manually. it should
> > pick up the default encoding out of the box
> 
> The maven java doc plugin is using the ${project.reporting.outputEncoding}
> as default [1]. Should we use that as default or the source file encoding?

I think we should use standard maven property

${project.build.sourceEncoding}

as default if set.
Comment 7 Martin Schreiber CLA 2015-01-19 14:00:46 EST
It's now possible to specify the encoding using the javaOptions/encoding property:

<plugin>
 <groupId>org.eclipse.tycho.extras</groupId>
 <artifactId>tycho-document-bundle-plugin</artifactId>
 <version>0.22.0</version>
 <configuration>
  <javadocOptions>
    <encoding>UTF-8</encoding>
  </javadocOptions>
 </configuration>
</plugin>

which will end up as "-encoding" javadoc parameter. 
If no encoding is specified, the maven property ${project.build.sourceEncoding} is used.
No "-encoding" javadoc parameter is added if both settings are nonexistent.