Repository navigation
IGNITE-29184 Build: Explicitly configure annotation processors in modules depending on ignite-codegen - #13732
Conversation
…ules depending on ignite-codegen Since JDK 23 javac does not run annotation processors found on the classpath unless they are configured explicitly. The calcite, indexing, zookeeper and control-utility modules relied on that implicit discovery, so on JDK 23+ their builds pass but message serializers and DTO factories are not generated and the node fails at runtime. List the processors each module needs explicitly, in pluginManagement so the inherited maven-compiler-plugin picks the configuration up without reordering the module's plugin executions (calcite's fmpp -> javacc pipeline depends on initialize-phase execution order): * calcite: MessageProcessor and org.immutables.processor.ProxyProcessor (generates the Immutable* rules and validator) * indexing, zookeeper: MessageProcessor * control-utility: IgniteDataTransferObjectProcessor (also covers test sources, which declare @argument DTOs of their own) Verified by comparing the generated file set of each module before and after a clean build: calcite 34 files, indexing 33, zookeeper 8, control-utility 2 test-source factories - all identical.
|
Thanks for the contribution. I have two points
|
…ocessor lists Replace the per-module <annotationProcessors> lists with a single <proc>full</proc> in the shared maven-compiler-plugin configuration of parent/pom.xml, as suggested in the review. Processors are then discovered through the ServiceLoader registration files shipped in ignite-codegen (and the immutables jar for calcite), so new modules depending on ignite-codegen get annotation processing for free. codegen overrides the parent with <proc>none</proc> (previously <compilerArgument>-proc:none</compilerArgument>) so the override uses the same configuration element and wins the merge deterministically instead of racing both flags on the command line. The flag is accepted since JDK 17.0.12 (backported alongside 11.0.24), so CI on JDK 17 is unaffected; building with 17.0.0 - 17.0.11 is no longer possible. Verified by clean-building the four modules and comparing the generated file sets across JDK 17.0.12, 21.0.5, 23.0.2 and 25.0.4.1 - identical on every JDK: calcite 34 files, indexing 33, zookeeper 8, control-utility 2 (test sources).
|
Hi @chesnokoff, thanks for the review!
Verified on JDK 17.0.12 / 21.0.5 / 23.0.2 / 25.0.4.1 by clean-building the four modules and comparing the generated file sets — identical on every JDK: calcite 34 files, indexing 33, zookeeper 8, control-utility 2 (test sources). (Note: a full reactor build on 23/25 still fails in core's test sources due to the One caveat to flag: the |
…tation-processors
|
Hi @chesnokoff, gentle follow-up: both points from your review are addressed in e793283 (comments removed; a single global |
|
Thanks for the new version, looks good to me. I had an idea to add to parent/pom.xml: <requireJavaVersion>
<version>[17.0.11,)</version>
<message>Building Ignite requires JDK 17.0.11 or later: javac must accept -proc:full.</message>
</requireJavaVersion>But looks like some of our ci test agents (Check Javadoc step) use < 17.0.11 so the rule can be added later. For now I run the patch on teamcity Also, a small correction: -proc:full was backported to 17.0.11 and 11.0.23 (JDK-8324670, JDK-8324804), so the unsupported range is 17.0.0–17.0.10. |
|
Thanks for the correction — right, |
TCBot Test Analysis
Possible Blockers (0)No blockers found. New Tests (1)
|
chesnokoff
left a comment
There was a problem hiding this comment.
LGTM. I'll find a committer to merge it
|
@XianReallyHot-ZZH Thanks for contribution! Merged to master. Please, for future contributions follow https://github.com/apache/ignite/blob/master/CONTRIBUTING.md guide to assign tickets to you |
Ticket: IGNITE-29184
What changes
Since JDK 23, javac no longer runs annotation processors found on the classpath unless they are configured explicitly. The calcite, indexing, zookeeper and control-utility modules relied on this implicit discovery, so on JDK 23+ their builds pass but message serializers / DTO factories are not generated and the node fails at runtime.
This lists the processors each module needs explicitly, configured in
pluginManagementso the inheritedmaven-compiler-pluginpicks the list up:calcite:MessageProcessor(message and metadata serializers/marshallers) andorg.immutables.processor.ProxyProcessor(generates the 14Immutable*rules andImmutableIgniteSqlValidator) — listing only the Ignite processor would trade one silent generation gap for another;indexing:MessageProcessor;zookeeper:MessageProcessor;control-utility:IgniteDataTransferObjectProcessor(management API DTO factories; also covers test sources, which declare@ArgumentDTOs of their own).ignite-corealready lists its processors explicitly (inbuild/plugins). The four modules here usepluginManagementinstead ofbuild/pluginsbecause declaringmaven-compiler-pluginin a module'sbuild/pluginsmakes Maven reorder the module's initialize-phase executions: in calcite,generate-fmpp-sourcesgets scheduled ahead ofcopy-fmpp-resources/unpack-parser-template, and the fmpp → javacc parser pipeline fails. Configuring throughpluginManagementapplies the processor list to the inherited plugin without touching plugin ordering.Testing
For each module, clean build before/after the change on JDK 21, comparing the full set of generated files:
test-compile).With an explicit processor list, annotation processing no longer depends on the JDK's discovery default, so JDK ≤ 21 behavior is unchanged and JDK 23+ keeps generating. Note:
control-utilitytest-compileneeds a currentignite-coresnapshot (IGNITE-29050 addedSnapshotDeleteCommand); verified green in a reactor build with-am.