[FLINK-39565] Eliminate maven build warnings across all modules#1105
[FLINK-39565] Eliminate maven build warnings across all modules#1105Dennis-Mircea wants to merge 2 commits into
Conversation
|
This is a somewhat large change that touches the build in a lot of places. Could we please open a jira for it? |
Thanks for the review! Sure, I opened FLINK-39565. I also applied a small fix for 2 failing e2e tests. Plase re-run the CI workflow, now it should be all fine. |
| "overlapping classes" warnings. | ||
| --> | ||
| <artifact>org.apache.flink:flink-runtime</artifact> | ||
| <excludes> |
There was a problem hiding this comment.
I am not sure if it's a good idea to enumerate and exclude the overlapping classes this way. When the overlapping classes are removed from the operator this will silently break the output uber jar. Maybe the warning is better than that scenario :)
gyfora
left a comment
There was a problem hiding this comment.
Overall looks good, the comments are a bit verbose but should be okay. My only concern is regarding the exclusion of the overlapping classes. Those come and go and this can lead to silent errors in the future
What is the purpose of the change
This pull request cleans up the maven build so that
mvn clean installproduces zero[WARNING]lines across all modules, while preserving runtime behavior of the operator, autoscaler, webhook, and example modules.The build was emitting hundreds of warnings spread across the RAT plugin, CycloneDX plugin, the shade plugin (operator, webhook, autoscaler-standalone, three example modules), and the assembly plugin (operator + webhook). None of them were blocking the build, but they masked legitimate signal during code review and CI runs.
This change is build-plumbing only: no production class, no CRD, no Helm value, no SPI contract, and no public API was modified.
Brief change log
apache-rat-plugin0.16.1→0.18, migrated to the v0.17 schema:tools/rat/rat-config.xmland wired in via the non-deprecated<configs>parameter (the old inline<families>/<licenses>/<approvedLicenses>are deprecated for removal in 0.17+).<configurationNoDefaults>true</configurationNoDefaults>disablesapache-rat-core/org/apache/rat/default.xml, which would otherwise also recogniseAL1.0/AL1.1(legacy Apache License) andMIT/BSD-3/CDDL1/OASIS/W3Cfamilies. The new ruleset declares a single familyALcontaining exactly one licenseAL2.0matched on the canonical ASF source-header openerLicensed to the Apache Software Foundation (ASF) under one, and approves only that family.<numUnapprovedLicenses>0</numUnapprovedLicenses>→<counterMaxs><counterMax>Unapproved:0</counterMax></counterMaxs>.<excludes>→<inputExcludes>. Added two pre-existing third-party files (LICENSE.rsync-deployments,e2e-tests/cert-manager.yaml) to the exclude list, they had been silently passing under RAT 0.16's permissive defaults.cyclonedx-maven-plugin2.9.0→2.9.1, plus.mvn/maven.configsetting-Dorg.slf4j.simpleLogger.log.com.networknt.schema=errorto silence the validator'sUnknown keyword meta:enum/Unknown keyword deprecatedchatter while keeping every other logger at default level.maven-shade-plugin3.1.1→3.6.2(centrally pinned in the root pom; required for MSHADE-460 / MSHADE-441 fixes aroundmodule-info.classfiltering). Configuration overhauled inflink-kubernetes-operator,flink-kubernetes-webhook,flink-autoscaler-standalone,examples/flink-beam-example,examples/flink-sql-runner-example,examples/autoscaling:*:*metadata<filters>block dropping JPMS module descriptors (module-info.class,META-INF/**/module-info.class), signature files (META-INF/*.SF/*.DSA/*.RSA), per-dep maven metadata (META-INF/maven/**), per-depLICENSE/NOTICE/DEPENDENCIES, Kotlin*.kotlin_modulefiles, ProGuard rules, GraalVM native-image hints, jandex indices, netty release metadata, andMETA-INF/MANIFEST.MF(regenerated byManifestResourceTransformer).org.apache.flink.runtime.rest.messages.{job.JobDetailsInfo, JobDetailsInfo$*, job.metrics.AggregatedMetric, job.metrics.IOMetricsInfo, JobExceptionsInfoWithHistory, JobExceptionsInfoWithHistory$*, json.SlotSharingGroupID(De)Serializer}win overflink-runtime; operator'sFlinkConfMountDecoratorwins overflink-kubernetes; operator'slog4j2.propertieswins overflink-kubernetes-operator-api's;okio-jvmwins overokioforMETA-INF/okio.kotlin_module.Log4j2PluginCacheFileTransformer(extensionorg.apache.logging.log4j:log4j-transform-maven-shade-plugin-extensions:0.2.0) to mergeLog4j2Plugins.datfromlog4j-coreandlog4j-1.2-api. Previously this resource was overwritten last-write-wins, which could silently drop log4j plugin definitions.<createDependencyReducedPom>false</createDependencyReducedPom>to theflink-kubernetes-operatorshade execution. The unshaded jar is the published main artifact (downstream modules likeflink-kubernetes-webhookcompile against it as a regular Maven dep), so the dep-reduced pom, which strips compile-scope deps such asflink-core,slf4j,fabric8,jackson, was breaking transitive resolution. Staledependency-reduced-pom.xmlfiles removed.maven-assembly-pluginpinned to3.8.0(operator + webhook);<finalName>test-plugins</finalName>moved from execution-scope to plugin-scope<configuration>(3.4+ rejects it as read-only at execution scope). Empty / leading-slash<outputDirectory>entries removed from both modules'src/test/assembly/test-plugins-assembly.xmlto drop the "*nix-specific root-relative reference" warning.org.apache.beam:beam-sdks-java-extensions-mlfrombeam-examples-javato silence the upstream "POM is invalid, transitive dependencies will not be available" warning (Beam 2.62.0 ships a malformed POM for that artifact). The bundled examples don't reference the ML extensions.Verifying this change
This change is a build/packaging cleanup with no functional code changes. It is verifiable by build and inspection rather than unit tests:
mvn clean install -DskipTestsfrom repo root →BUILD SUCCESS, zero[WARNING]lines.mvn -pl flink-kubernetes-webhook,flink-autoscaler-standalone -am package -DskipTests→BUILD SUCCESS, zero[WARNING]lines.mvn -N apache-rat:checkwith a probe Java file carrying an MIT-style header dropped intoflink-autoscaler/src/main/java/...is rejected withUnknown license (Unapproved)and trips theUnapproved:0counter, confirming the RAT policy is strictly AL2.0 (regression vs. the previous setup where the entireALfamily, including legacy AL1.0/AL1.1, was approved by default).unzip -l flink-kubernetes-operator/target/flink-kubernetes-operator-*-shaded.jar | grep -E "FlinkConfMountDecorator|AggregatedMetric|JobDetailsInfo|Log4j2Plugins\.dat|module-info"→ confirms forks present, nomodule-info.class, single mergedLog4j2Plugins.dat.Does this pull request potentially affect one of the following parts:
apache-rat-plugin0.16.1 → 0.18;cyclonedx-maven-plugin2.9.0 → 2.9.1;maven-shade-plugin3.1.1 → 3.6.2;maven-assembly-pluginpinned to 3.8.0 (was 3.2.0 inherited); shade-plugin extensionorg.apache.logging.log4j:log4j-transform-maven-shade-plugin-extensions:0.2.0added. No runtime dependency was added, removed, or upgraded, the set of classes on the shaded classpath is unchanged.CustomResourceDescriptors: noDocumentation