[FLINK-34234] Apply ShadeOptionalChecker for flink-shaded
~~As a test [1] there was first a commit with enabling ShadeOptionalChecker however without adding optional. As a result it detects the issue i a number of places.~~
UPD: Since bumping version of flatten plugin helps I reverted changes (to not force push) and added version bump itself to 1.2.7 also keep a couple of hotfix commits as a result of review
force-pushed since have to extract license related update into a separate commit
Thanks for your feedback @zentol I checked locally with 1.2.7 flatten plugin and confirm that it resolves the issue
So I bumped the issue and currently reverted previous changes regarding shading...
May be one question which is still not clear to me (not directly related to perf regression) Could you please clarify: In release's profile[1] for flink-shaded it is mentioned that we need to use maven < 3.3 to release. Playing locally I was not able to find a difference between the result of usage 3.2.5 and 3.8.6 (for both the perf regression issue is reproduced in case of flatten plugin 1.2.1 and for both it is fixed with 1.2.7). Do we need still apply ShadeOptionalChecker's approach like in Flink main repo to safely use 3.8.6 during release?
[1] https://github.com/apache/flink-shaded/blob/b4f9ed2dc85b3dcbb4bfc3bdb6866505bfae6893/pom.xml#L136-L137
was not able to find a difference
That's because flink-shaded modules are all self-contained; no flink-shaded module depends on another flink-shaded module, due to which right now it's not affected by the problem we had in the main repo.
This means you can probably use newer maven versions, but still shouldn't until we have added safeguards that either no interdependencies between modules exist or everything is marked as optional. But I'd treat that as a separate issue altogether.