Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not execute spotless in Java 21 #11670

Merged
merged 1 commit into from
Sep 25, 2023

Conversation

gortiz
Copy link
Contributor

@gortiz gortiz commented Sep 25, 2023

The reason to be of this PR is to be able to progress on #11656.

Spotless does not support Java 21 yet (see diffplug/spotless#1822) so this PR moves the spotless usage to its own profile, which is active automatically if and only if the JVM being used is not 21. Once Spotless support Java 21 (probably when diffplug/spotless#1822 is merged) we could just remove this profile and move the spotless config to the build->pluginManagement section.

Why don't just disable spotless with -Dspotless.skip?

IT would be a great, but spotless doesn't work in that way. Even with that property set, spotless actually executes. What the flag controls is whether the pipeline should fail or not if spotless detects an issue in the code (like importing something that is not being used). When using Java 21, spotless throws an exception that is not caught, so it always aborts the maven execution, even if -Dspotless.skip is set.

This changes are included in #11672, so we can decide to merge this alone or merge everything together.

@gortiz gortiz mentioned this pull request Sep 25, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #11670 (2cb9bbb) into master (e6655dd) will decrease coverage by 48.66%.
The diff coverage is n/a.

@@              Coverage Diff              @@
##             master   #11670       +/-   ##
=============================================
- Coverage     63.10%   14.44%   -48.66%     
+ Complexity     1121      201      -920     
=============================================
  Files          2343     2343               
  Lines        125693   125691        -2     
  Branches      19310    19310               
=============================================
- Hits          79315    18157    -61158     
- Misses        40728   105997    +65269     
+ Partials       5650     1537     -4113     
Flag Coverage Δ
integration ?
integration1 ?
integration2 ?
java-11 14.44% <ø> (-48.61%) ⬇️
java-17 ?
java-20 ?
temurin 14.44% <ø> (-48.66%) ⬇️
unittests 14.44% <ø> (-48.66%) ⬇️
unittests1 ?
unittests2 14.44% <ø> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1518 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Jackie-Jiang Jackie-Jiang merged commit e144147 into apache:master Sep 25, 2023
23 checks passed
@gortiz gortiz mentioned this pull request Sep 27, 2023
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants