-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Re-enable the Spotless plugin for Java 21 #12992
Merged
Jackie-Jiang
merged 5 commits into
apache:master
from
yashmayya:reenable-spotless-java-21
Apr 25, 2024
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ef86863
Re-enable the Spotless plugin for Java 21
yashmayya 2542ea0
Move excludes to parent POM and remove plugin override in pinot-commo…
yashmayya 7e3b9b1
Revert "Move excludes to parent POM and remove plugin override in pin…
yashmayya a9627e0
Remove redundant verify phase binding for spotless plugin's check goal
yashmayya 1bd1dee
Remove configurations from spotless-maven-plugin in pinot-common POM …
yashmayya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -255,20 +255,6 @@ | |
</properties> | ||
|
||
<profiles> | ||
<profile> | ||
<id>not-java-21</id> | ||
<activation> | ||
<jdk>!21</jdk> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.diffplug.spotless</groupId> | ||
<artifactId>spotless-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
<profile> | ||
<id>github-actions</id> | ||
<activation> | ||
|
@@ -1625,7 +1611,6 @@ | |
<version>2.43.0</version> | ||
<executions> | ||
<execution> | ||
<phase>verify</phase> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't required because |
||
<goals> | ||
<goal>check</goal> | ||
</goals> | ||
|
@@ -2080,6 +2065,10 @@ | |
<artifactId>sonar-maven-plugin</artifactId> | ||
<version>2.7.1</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>com.diffplug.spotless</groupId> | ||
<artifactId>spotless-maven-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>com.mycila</groupId> | ||
<artifactId>license-maven-plugin</artifactId> | ||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually keep the plugin management inside the root pom, and then we can simply use it here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change is fine. Basically he moved this from pluginManagement to plugin. Given there is no child project that inherits its pom, I think this is the right move.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I assumed that #11670 introduced the
pluginManagement
in this POM for the JDK 21 build profile (i.e., to avoid running this plugin's goal with Java 21)? Also we're overriding the plugin configuration here (for the separate excludes I presume), so it's not like we can simply define it here without the configuration right?Edit: We're still leveraging the plugin management from the parent POM since we aren't redefining the plugin version or executions here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I meant is that we should be able to put the
excludes
in the root pom where there is another configuration for this plug-in, then we keep a single configuration for this plug-in for easier managementThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah okay, I've made that change. Not sure why it was like that earlier - perhaps to avoid adding child module specific excludes in the parent POM? Looks like it was added in https://github.com/apache/pinot/pull/8427/files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that is a bad practice. This is the project that knows which files should be ignored. In case other projects want to do the same we don't want to merge that information.
The pom project should specify the plugin version and the common configuration. Configuration specific to each sub-project should be configured by each sub-project
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, I've reverted the last commit to keep things as they were previously.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gortiz Does it work if we only keep the
excludes
config here? Keeping separateexcludes
per module definitely make sense, but replicating other fields can add management overheadThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on https://maven.apache.org/pom.html#plugins, that should work and it is supported behavior. I've pushed a commit making this change and also verified locally that it works as expected.