quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.7k stars 2.65k forks source link

avro.codegen.enableDecimalLogicalType=true doesn't take effect #19281

Closed Dieken closed 3 years ago

Dieken commented 3 years ago

Describe the bug

I use quarkus-avro to generate Java class from avsc files in src/main/avro, but avro.codegen.enableDecimalLogicalType=true in src/main/resources/application.properties doesn't take effect, my decimal field is still generated as ByteBuffer. avro-maven-plugin doesn't have this problem.

Expected behavior

decimal field should be BigDecimal in generated Java file.

Actual behavior

decimal field still uses ByteBuffer.

How to Reproduce?

  1. get an avsc file that contains decimal field
  2. put the avsc file in src/main/avro
  3. add extension quarkus-avro to pom.xml
  4. set avro.codegen.enableDecimalLogicalType=true in src/main/resources/application.properties
  5. mvn clean package

Output of uname -a or ver

Darwin aaa-mbp.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64

Output of java -version

openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

Client Version 2.1.1.Final

Build tool (ie. output of mvnw --version or gradlew --version)

$ ./mvnw --version
Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Maven home: /Users/aaa/.m2/wrapper/dists/apache-maven-3.8.1-bin/2l5mhf2pq2clrde7f7qp1rdt5m/apache-maven-3.8.1
Java version: 11.0.11, vendor: AdoptOpenJDK, runtime: /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home 
Default locale: en_CN, platform encoding: UTF-8
OS name: "mac os x", version: "11.2", arch: "x86_64", family: "mac"

Additional information

No response

Dieken commented 3 years ago

Can't find avro.codegen related configuration at https://quarkus.io/guides/all-config

Dieken commented 3 years ago

The property must be specified in pom.xml, not in application.properties.