Dennis-Mircea opened a new pull request, #1105:
URL: https://github.com/apache/flink-kubernetes-operator/pull/1105
<!--
*Thank you very much for contributing to the Apache Flink Kubernetes
Operator - we are happy that you want to help us improve the project. To help
the community review your contribution in the best possible way, please go
through the checklist below, which will get the contribution into a shape in
which it can be best reviewed.*
## Contribution Checklist
- Make sure that the pull request corresponds to a [JIRA
issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are
made for typos in JavaDoc or documentation files, which need no JIRA issue.
- Name the pull request in the form "[FLINK-XXXX] [component] Title of the
pull request", where *FLINK-XXXX* should be replaced by the actual issue
number. Skip *component* if you are unsure about which is the best component.
Typo fixes that have no associated JIRA issue should be named following
this pattern: `[hotfix][docs] Fix typo in event time introduction` or
`[hotfix][javadocs] Expand JavaDoc for PuncuatedWatermarkGenerator`.
- Fill out the template below to describe the changes contributed by the
pull request. That will give reviewers the context they need to do the review.
- Make sure that the change passes the automated tests, i.e., `mvn clean
verify` passes. You can read more on how we use GitHub Actions for CI
[here](https://nightlies.apache.org/flink/flink-kubernetes-operator-docs-main/docs/development/guide/#cicd).
- Each pull request should address only one issue, not mix up code from
multiple issues.
- Each commit in the pull request has a meaningful commit message
(including the JIRA id)
- Once all items of the checklist are addressed, remove the above text and
this checklist, leaving only the filled out template below.
**(The sections below can be removed for hotfixes of typos)**
-->
## What is the purpose of the change
This pull request cleans up the maven build so that `mvn clean install`
produces 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-plugin` `0.16.1` → `0.18`**, migrated to the v0.17 schema:
- Custom ruleset extracted to `tools/rat/rat-config.xml` and wired in via
the non-deprecated `<configs>` parameter (the old inline `<families>` /
`<licenses>` / `<approvedLicenses>` are deprecated for removal in 0.17+).
- `<configurationNoDefaults>true</configurationNoDefaults>` disables
`apache-rat-core/org/apache/rat/default.xml`, which would otherwise also
recognise `AL1.0` / `AL1.1` (legacy Apache License) and `MIT` / `BSD-3` /
`CDDL1` / `OASIS` / `W3C` families. The new ruleset declares a single family
`AL` containing exactly one license `AL2.0` matched on the canonical ASF
source-header opener `Licensed 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-plugin` `2.9.0` → `2.9.1`**, plus `.mvn/maven.config`
setting `-Dorg.slf4j.simpleLogger.log.com.networknt.schema=error` to silence
the validator's `Unknown keyword meta:enum` / `Unknown keyword deprecated`
chatter while keeping every other logger at default level.
- **`maven-shade-plugin` `3.1.1` → `3.6.2`** (centrally pinned in the root
pom; required for MSHADE-460 / MSHADE-441 fixes around `module-info.class`
filtering). Configuration overhauled in `flink-kubernetes-operator`,
`flink-kubernetes-webhook`, `flink-autoscaler-standalone`,
`examples/flink-beam-example`, `examples/flink-sql-runner-example`,
`examples/autoscaling`:
- Comprehensive `*:*` 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-dep `LICENSE` / `NOTICE` / `DEPENDENCIES`, Kotlin
`*.kotlin_module` files, ProGuard rules, GraalVM native-image hints, jandex
indices, netty release metadata, and `META-INF/MANIFEST.MF` (regenerated by
`ManifestResourceTransformer`).
- Deterministic per-artifact "winner" filters for previously-overlapping
intentional forks: operator/autoscaler forks of
`org.apache.flink.runtime.rest.messages.{job.JobDetailsInfo, JobDetailsInfo$*,
job.metrics.AggregatedMetric, job.metrics.IOMetricsInfo,
JobExceptionsInfoWithHistory, JobExceptionsInfoWithHistory$*,
json.SlotSharingGroupID(De)Serializer}` win over `flink-runtime`; operator's
`FlinkConfMountDecorator` wins over `flink-kubernetes`; operator's
`log4j2.properties` wins over `flink-kubernetes-operator-api`'s; `okio-jvm`
wins over `okio` for `META-INF/okio.kotlin_module`.
- Added `Log4j2PluginCacheFileTransformer` (extension
`org.apache.logging.log4j:log4j-transform-maven-shade-plugin-extensions:0.2.0`)
to *merge* `Log4j2Plugins.dat` from `log4j-core` and `log4j-1.2-api`.
Previously this resource was overwritten last-write-wins, which could silently
drop log4j plugin definitions.
- Added `<createDependencyReducedPom>false</createDependencyReducedPom>`
to the `flink-kubernetes-operator` shade execution. The unshaded jar is the
published main artifact (downstream modules like `flink-kubernetes-webhook`
compile against it as a regular Maven dep), so the dep-reduced pom, which
strips compile-scope deps such as `flink-core`, `slf4j`, `fabric8`, `jackson`,
was breaking transitive resolution. Stale `dependency-reduced-pom.xml` files
removed.
- **`maven-assembly-plugin` pinned to `3.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.xml` to drop the
"*nix-specific root-relative reference" warning.
- **Beam example**: excluded `org.apache.beam:beam-sdks-java-extensions-ml`
from `beam-examples-java` to 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
<!--
Please make sure both new and modified tests in this PR follows the
conventions defined in our code quality guide:
https://flink.apache.org/contributing/code-style-and-quality-common.html#testing
-->
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 -DskipTests` from 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:check` with a probe Java file carrying an MIT-style
header dropped into `flink-autoscaler/src/main/java/...` is **rejected** with
`Unknown license (Unapproved)` and trips the `Unapproved:0` counter, confirming
the RAT policy is strictly AL2.0 (regression vs. the previous setup where the
entire `AL` family, 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, no `module-info.class`, single merged
`Log4j2Plugins.dat`.
- All existing operator IT and unit tests continue to pass with no changes.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): **yes (build-time
only)**. `apache-rat-plugin` 0.16.1 → 0.18; `cyclonedx-maven-plugin` 2.9.0 →
2.9.1; `maven-shade-plugin` 3.1.1 → 3.6.2; `maven-assembly-plugin` pinned to
3.8.0 (was 3.2.0 inherited); shade-plugin extension
`org.apache.logging.log4j:log4j-transform-maven-shade-plugin-extensions:0.2.0`
added. No runtime dependency was added, removed, or upgraded, the set of
classes on the shaded classpath is unchanged.
- The public API, i.e., is any changes to the `CustomResourceDescriptors`:
no
- Core observer or reconciler logic that is regularly executed: no
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
--
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]