-
Notifications
You must be signed in to change notification settings - Fork 8.9k
bugfix: mvn spotless:apply failed #7644
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
base: 2.x
Are you sure you want to change the base?
bugfix: mvn spotless:apply failed #7644
Conversation
Hi. @xingfudeshi Thank you for changing the Chinese phrase. |
No worries. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 2.x #7644 +/- ##
============================================
- Coverage 61.05% 60.99% -0.06%
+ Complexity 670 666 -4
============================================
Files 1316 1316
Lines 49804 49804
Branches 5855 5855
============================================
- Hits 30407 30378 -29
- Misses 16689 16714 +25
- Partials 2708 2712 +4
🚀 New features to boost your workflow:
|
354a075
to
e1518f1
Compare
case TimeoutRollbacked: | ||
case Rollbacked: | ||
// rollback transactions but do not exist are usually considered completed | ||
// rollback transactions but do not exist are usually considered completed |
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.
In Java 11, this comment should be indented, but not indented in Java17, Java25, which is a problem.
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.
In Java 11, this comment should be indented, but not indented in Java17, Java25, which is a problem.
Yes — with your current changes, everything for Java11 and above should now follow the same coding style, right?
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.
Java 11 (Has Error ❌)
$ sdk use java 11.0.27-librca
$ ./mvnw spotless:check
[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.44.3:check (default-cli) on project seata-tm: The following files had format violations:
[ERROR] src/main/java/org/apache/seata/tm/api/TransactionalTemplate.java
[ERROR] @@ -290,7 +290,7 @@
[ERROR] ················break;
[ERROR] ············case·TimeoutRollbacked:
[ERROR] ············case·Rollbacked:
[ERROR] -············//·rollback·transactions·but·do·not·exist·are·usually·considered·completed
[ERROR] +················//·rollback·transactions·but·do·not·exist·are·usually·considered·completed
[ERROR] ············case·Finished:
[ERROR] ················code·=·TransactionalExecutor.Code.RollbackDone;
[ERROR] ················break;
[ERROR] Run 'mvn spotless:apply' to fix these violations.
Java 17 and above (✅)
$ sdk use java 17.0.16-librca (java 21, java 25 OK)
$ ./mvnw spotless:check
[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.44.3:check (default-cli) on project seata-tm: The following files had format violations:
[ERROR] src/main/java/org/apache/seata/tm/api/TransactionalTemplate.java
[ERROR] @@ -290,7 +290,7 @@
[ERROR] ················break;
[ERROR] ············case·TimeoutRollbacked:
[ERROR] ············case·Rollbacked:
[ERROR] -················//·rollback·transactions·but·do·not·exist·are·usually·considered·completed
[ERROR] +············//·rollback·transactions·but·do·not·exist·are·usually·considered·completed
[ERROR] ············case·Finished:
[ERROR] ················code·=·TransactionalExecutor.Code.RollbackDone;
[ERROR] ················break;
[ERROR] Run 'mvn spotless:apply' to fix these violations.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :seata-tm
This is the situation above, so there's no problem starting with Java 17 or later.
I have a problem with Java 11. And this happens unconditionally because the position of the comment changes.
What should I do in this situation? (In CI, Java 17 is set, so there is no problem.)
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.
Java 11 (Has Error ❌)
$ sdk use java 11.0.27-librca $ ./mvnw spotless:check [ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.44.3:check (default-cli) on project seata-tm: The following files had format violations: [ERROR] src/main/java/org/apache/seata/tm/api/TransactionalTemplate.java [ERROR] @@ -290,7 +290,7 @@ [ERROR] ················break; [ERROR] ············case·TimeoutRollbacked: [ERROR] ············case·Rollbacked: [ERROR] -············//·rollback·transactions·but·do·not·exist·are·usually·considered·completed [ERROR] +················//·rollback·transactions·but·do·not·exist·are·usually·considered·completed [ERROR] ············case·Finished: [ERROR] ················code·=·TransactionalExecutor.Code.RollbackDone; [ERROR] ················break; [ERROR] Run 'mvn spotless:apply' to fix these violations.Java 17 and above (✅)
$ sdk use java 17.0.16-librca (java 21, java 25 OK) $ ./mvnw spotless:check [ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.44.3:check (default-cli) on project seata-tm: The following files had format violations: [ERROR] src/main/java/org/apache/seata/tm/api/TransactionalTemplate.java [ERROR] @@ -290,7 +290,7 @@ [ERROR] ················break; [ERROR] ············case·TimeoutRollbacked: [ERROR] ············case·Rollbacked: [ERROR] -················//·rollback·transactions·but·do·not·exist·are·usually·considered·completed [ERROR] +············//·rollback·transactions·but·do·not·exist·are·usually·considered·completed [ERROR] ············case·Finished: [ERROR] ················code·=·TransactionalExecutor.Code.RollbackDone; [ERROR] ················break; [ERROR] Run 'mvn spotless:apply' to fix these violations. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn <args> -rf :seata-tmThis is the situation above, so there's no problem starting with Java 17 or later.
I have a problem with Java 11. And this happens unconditionally because the position of the comment changes.
What should I do in this situation? (In CI, Java 17 is set, so there is no problem.)
Have you consulted the Spotless community about how to resolve this issue?
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.
For now, I think it’s best to wait for a reply on this issue.
If no response comes for a long time, then we may need to proceed with running Spotless only on a specific version.
Ⅰ. Describe what this PR did
Ⅱ. Does this pull request fix one issue?
fixes: #7640
Ⅲ. Why don't you add test cases (unit test/integration test)?
Just Maven Spoltess applied
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews