You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/12/02 09:45:00 UTC

[jira] [Commented] (MJAVADOC-544) Changed behaviour of Javadoc for temporary files encoding (options, argfile, ...)

    [ https://issues.apache.org/jira/browse/MJAVADOC-544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16706155#comment-16706155 ] 

ASF GitHub Bot commented on MJAVADOC-544:
-----------------------------------------

rfscholte commented on a change in pull request #10: [MJAVADOC-544] - Changed behaviour of Javadoc for temporary files encoding (options, argfile, ...)
URL: https://github.com/apache/maven-javadoc-plugin/pull/10#discussion_r238091505
 
 

 ##########
 File path: src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
 ##########
 @@ -4414,9 +4430,15 @@ private void addCommandLineArgFile( Commandline cmd, File javadocOutputDirectory
             cmd.createArg().setValue( "@" + FILES_FILE_NAME );
         }
 
+        /* default to platform encoding */
+        String encoding = null;
+        if ( JAVA_VERSION.compareTo( SINCE_JAVADOC_9 ) >= 0 )
 
 Review comment:
   Don't forget to squash your commits

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Changed behaviour of Javadoc for temporary files encoding (options, argfile, ...)
> ---------------------------------------------------------------------------------
>
>                 Key: MJAVADOC-544
>                 URL: https://issues.apache.org/jira/browse/MJAVADOC-544
>             Project: Maven Javadoc Plugin
>          Issue Type: Bug
>          Components: javadoc
>    Affects Versions: 3.0.1
>         Environment: JDK9+, Windows
>            Reporter: Michael Stumpf
>            Priority: Major
>
> With JDK9 the behaviour of javadoc has apparently changed (at least on Windows platform).
> In a project with special characters (umlaut) in the organization name the content of the options file was written with the default platform encoding (cp1252).
> As a result, the javadoc generation fails on javadoc execution with "Exit code: 1 - javadoc: error - cannot read Input length = 1".
> With JDK8 javadoc generation works.
> It also succeeds with JDK9 and setting the environment variable: JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8
> However, this should not be necessary, and maven-javadoc-plugin should work out of the box.
>  
> h6. Cause:
> After some tests it appears to be the case that the JDK9 Javadoc reads @-files always with UTF-8 charset, regardless of platform encoding.
> I looked into the issue and prepared a patch for the plugin when working with JDK9+ and added two tests for the temporary files options and argfile.
> To my knowledge, the temporary file "packages" cannot contain special characters, since this isn't allowed in the java specification, so no workaround is added.
> The file javadoc.bat is not affected (a test with a JDK in the directory "C:\jdk9äöüß" worked with the file being platform encoded).
> h6. 
> Resolution:
> I'll try to create a pull request from https://github.com/michael-st/maven-javadoc-plugin



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)