Activate Spotless via Maven property rather than file #742
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thanks to the many plugin maintainers who have adopted the new configuration introduced in #733. This has allowed me to clean up the way this configuration is activated by lifting it out of a custom profile into the main section of the build. To keep it off by default I am defining
<spotless.check.skip>true</spotless.check.skip>
by default. Plugins can override this property to<spotless.check.skip>false</spotless.check.skip>
to enable Spotless. The documentation now recommends this over the file-based activation method. The file-based activation method still works as a compatibility bridge but just sets this property. After this PR is merged, I will go through any plugins using the file-based activation method and convert them to the property method, then finally remove the file-based activation from this POM.The only risk here is to the handful of plugins that are still defining their own configuration:
Since I have filed PRs to update most of these to use the standard configuration I am not worried. If for some reason the maintainers refuse to use the standard configuration then they will have to figure out how to harmonize their configuration with mine. An example of how to do this is in jenkinsci/additional-metrics-plugin#23 where I blended in the maintainer's preference for a license header check.
As part of this PR I have also enabled Spotless for this repository's test suite and formatted any test plugins to enhance test coverage.