Avro code generation not triggering in 2.5 line #22023
-
We have a project including the product-schema-service on feature/POE-4482-send-ev… [$!?] via ☕ v11.0.13 via v17.1.0 ☸ admin@staging (team-ccc)
❯ mvn clean generate-sources
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< one.plan:product-schema-service >-------------------
[INFO] Building product-schema-service 2.7.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ product-schema-service ---
[INFO] Deleting /home/languitar/src/product-schema-service/target
[INFO]
[INFO] --- quarkus-maven-plugin:2.4.1.Final:generate-code (default) @ product-schema-service ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.348 s
[INFO] Finished at: 2021-12-08T12:22:03+01:00
[INFO] ------------------------------------------------------------------------
product-schema-service on feature/POE-4482-send-ev… [$!?] via ☕ v11.0.13 via v17.1.0 ☸ admin@staging (team-ccc) took 4s
❯ vim pom.xml
product-schema-service on feature/POE-4482-send-ev… [$!?] via ☕ v11.0.13 via v17.1.0 ☸ admin@staging (team-ccc) took 3s
❯ mvn clean generate-sources
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< one.plan:product-schema-service >-------------------
[INFO] Building product-schema-service 2.7.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ product-schema-service ---
[INFO] Deleting /home/languitar/src/product-schema-service/target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.863 s
[INFO] Finished at: 2021-12-08T12:22:12+01:00
[INFO] ------------------------------------------------------------------------ Did anything change in the way the Quarkus maven plugin has to be configured with 2.5 to get this going again? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
/cc @cescoffier |
Beta Was this translation helpful? Give feedback.
-
The problem is related to the Maven phases and the fact that the Kotlin compilation was happening before the Avro generation.
Projects generated from https://code.quarkus.io configure the project correctly. The <plugins>
<plugin>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus.platform.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>build</goal>
<goal>generate-code</goal>
<goal>generate-code-tests</goal>
</goals>
</execution>
</executions>
</plugin>
...
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<goals>
<goal>compile</goal> <!-- bound to the compile phase, after the Quarkus Avro generation -->
</goals>
</execution>
<execution>
<id>test-compile</id>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-allopen</artifactId>
<version>${kotlin.version}</version>
</dependency>
</dependencies>
<configuration>
<javaParameters>true</javaParameters>
<jvmTarget>11</jvmTarget>
<compilerPlugins>
<plugin>all-open</plugin>
</compilerPlugins>
<pluginOptions>
<option>all-open:annotation=javax.ws.rs.Path</option>
<option>all-open:annotation=javax.enterprise.context.ApplicationScoped</option>
<option>all-open:annotation=io.quarkus.test.junit.QuarkusTest</option>
</pluginOptions>
</configuration>
</plugin>
</plugins> |
Beta Was this translation helpful? Give feedback.
The problem is related to the Maven phases and the fact that the Kotlin compilation was happening before the Avro generation.
The right order is the following: