You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/11/01 21:35:01 UTC

[jira] [Commented] (AVRO-2207) avro-maven-plugin don't specify encoding for files generated from avdls and avprs

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

ASF GitHub Bot commented on AVRO-2207:
--------------------------------------

dkulp closed pull request #324: AVRO-2207: avro-maven-plugin: Using project.build.sourceEncoding for files generated from avdl/avpr
URL: https://github.com/apache/avro/pull/324
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/lang/java/maven-plugin/src/main/java/org/apache/avro/mojo/IDLProtocolMojo.java b/lang/java/maven-plugin/src/main/java/org/apache/avro/mojo/IDLProtocolMojo.java
index 3c9542e3a..dfee5c73c 100644
--- a/lang/java/maven-plugin/src/main/java/org/apache/avro/mojo/IDLProtocolMojo.java
+++ b/lang/java/maven-plugin/src/main/java/org/apache/avro/mojo/IDLProtocolMojo.java
@@ -94,6 +94,7 @@ protected void doCompile(String filename, File sourceDirectory, File outputDirec
       compiler.setFieldVisibility(getFieldVisibility());
       compiler.setCreateSetters(createSetters);
       compiler.setEnableDecimalLogicalType(enableDecimalLogicalType);
+      compiler.setOutputCharacterEncoding(project.getProperties().getProperty("project.build.sourceEncoding"));
       compiler.compileToDestination(null, outputDirectory);
     } catch (ParseException e) {
       throw new IOException(e);
diff --git a/lang/java/maven-plugin/src/main/java/org/apache/avro/mojo/ProtocolMojo.java b/lang/java/maven-plugin/src/main/java/org/apache/avro/mojo/ProtocolMojo.java
index a4dbe65af..b370d664c 100644
--- a/lang/java/maven-plugin/src/main/java/org/apache/avro/mojo/ProtocolMojo.java
+++ b/lang/java/maven-plugin/src/main/java/org/apache/avro/mojo/ProtocolMojo.java
@@ -62,6 +62,7 @@ protected void doCompile(String filename, File sourceDirectory, File outputDirec
     compiler.setFieldVisibility(getFieldVisibility());
     compiler.setCreateSetters(createSetters);
     compiler.setEnableDecimalLogicalType(enableDecimalLogicalType);
+    compiler.setOutputCharacterEncoding(project.getProperties().getProperty("project.build.sourceEncoding"));
     compiler.compileToDestination(src, outputDirectory);
   }
 


 

----------------------------------------------------------------
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


> avro-maven-plugin don't specify encoding for files generated from avdls and avprs
> ---------------------------------------------------------------------------------
>
>                 Key: AVRO-2207
>                 URL: https://issues.apache.org/jira/browse/AVRO-2207
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.8.2
>            Reporter: Arek Burdach
>            Priority: Major
>
> When someone generates source file from avdl/avpr, compiler uses system default encoding for output files. It can be different from this expected by project's compiler. It is quite usual thing that developers specify source encoding on project level using {{project.build.sourceEncoding}} property and expects that it will solve the problem.
> The problem doesn't exists when sources are generated from avsc. That implementation sets output encoding to this taken from {{project.build.sourceEncoding}}.
> Proposed solutions is to use the same behaviour in other two cases (avdl and avpr).
>  



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