Martijn Visser created FLINK-40630:
--------------------------------------
Summary: Use Apache Parent POM 39 in flink-connector-parent
Key: FLINK-40630
URL: https://issues.apache.org/jira/browse/FLINK-40630
Project: Flink
Issue Type: Technical Debt
Components: Connectors / Common
Reporter: Martijn Visser
flink-connector-parent 2.0.0 still inherits from org.apache:apache:20 (2018).
Apache Parent POM 39 is out and Flink itself moved in FLINK-40510.
Two things break on the way and both were reproduced locally against
flink-connector-kafka:
Apache parent 39 activates a jdk9+ profile that sets {{maven.compiler.release}}
to its {{javaVersion}} (8), and maven-compiler-plugin lets release override
source/target. The connector parent sets source 11 / target 17 and no release,
so the build fails outright rather than silently downgrading:
{noformat}
[INFO] Compiling 130 source files with javac [debug release 8] to target/classes
[ERROR] TransactionOwnership.java:[74,29] method orElseThrow in class
java.util.Optional<T> cannot be applied to given types
{noformat}
Setting javaVersion alone is not a fix, because it would also cap the
java17-target profile at bytecode 55. Blanking {{maven.compiler.release}} fixes
the compiler but breaks maven-javadoc-plugin (both 3.8.0 and 3.12.0) with
"String index out of range: 0". What works is keeping the property non-empty
and overriding the compiler plugin's release parameter instead.
Second, javadoc rejects an add-exports J-option together with release
("exporting a package from system module java.base is not allowed with the
release option"), so the add-exports option the parent's jdk profile passes to
javadoc has to go. Whether any connector's javadoc actually needs it should be
checked before the parent is released.
Apache parent 39 also sets {{minimalMavenBuildVersion}} to 3.9 and enforces it
in every module, so every connector adopting the new parent must build with
Maven 3.9+. None of the other connector repos (aws, mongodb, opensearch, jdbc,
elasticsearch, rabbitmq, cassandra) has a Maven wrapper at all, so the shared
CI falls back to its hardcoded 3.8.6 for them. They need a wrapper, or the CI
fallback has to move, before they take the new parent.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)