sd4324530 opened a new pull request, #4633:
URL: https://github.com/apache/flink-cdc/pull/4633
## What is the purpose of this pull request?
Make the root pom the single Flink generation switch point. Today the
1.20-vs-2.2 switching is scattered across module-local `flink1`/`flink2`
profiles (cli, common, composer, runtime, connect, source-connectors, dist,
pipeline-e2e-tests, plus the elasticsearch connector's local version switch) -
and the root pom's `flink2` profile did not even switch `flink.version`. After
this PR a module carries no generation-scoped property of its own; enabling
`-Pflink2` at the root switches everything.
This is the second step of the multi-version compatibility refactor tracked
in FLINK-41452 (sub-task: FLINK-41642), stacked on top of the module-rename PR,
and is a pure property move: no effective value changes anywhere.
## Brief change log
* The root pom gains a `flink.compat.artifactId` default
(`flink-cdc-flink-1.20`), and its `flink2` profile now sets `flink.version`,
`flink.compat.artifactId` and the elasticsearch connector version, alongside
the kafka / paimon / iceberg / fluss versions it already switched.
* The local switches are removed from cli, common, composer, runtime,
connect, source-connectors, dist and pipeline-e2e-tests, together with the
elasticsearch connector's local `flink.connector.elasticsearch.version`
override. The modules take an unconditional `${flink.compat.artifactId}`
dependency instead of per-profile compat declarations, with the per-module
scopes preserved exactly.
* What stays module-local is genuinely module-local:
- cli / common / composer / runtime keep a slim `flink2` profile whose
only job is to activate the root pom's flink2 test classpath machinery - the
`copy-flink2-guava` execution and the surefire additional classpath elements
are defined in the root pom's pluginManagement, and they only run for modules
that declare the plugins. Removing those declarations would silently drop guava
from the flink2 test classpath.
- dist keeps only the 2.x shaded guava dependency in its `flink2` profile;
the 1.x flavor comes from the dependency inherited from the root pom.
- connect keeps its compat test-jar machinery and `copy-flink2-extra-libs`
unchanged; runtime keeps `flink2-exclude-flink1`. The guava handling is
untouched.
## Verifying this change
* Full `mvn clean install -DskipTests` on JDK 11 for both generations
(default and `-Pflink2`), with the repository gates (spotless / checkstyle)
green.
* Property equivalence: every switched property (`flink.version`,
`flink.compat.artifactId`, the kafka and elasticsearch connector versions)
evaluates to exactly the same values on both profiles as before the change
(`mvn help:evaluate` on both profiles).
* Artifact equivalence: the flink2-line dist and mysql connector fat jars
are class-for-class identical to the build before this change (12,770 / 11,406
classes, no differences); the flink1-line fat jars still contain the complete
compat class set (21 / 21 classes).
* `-Pflink2` unit tests of the core modules pass, and the copied guava33
jars are present in `target/flink2-extra-libs`, so the flink2 test classpath
machinery is verified active.
## Documentation
- Does this pull request introduce a new feature? (no)
- If yes, how is the feature documented? (not applicable)
---
##### Was generative AI tooling used to co-author this PR?
- [x] Yes (please specify the tool below)
Generated-by: CodeBuddy (GLM-5.3)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]