You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have google-java-format intellij plugin installed and configured to use AOSP style, and spotless maven plugin that is configured with AOSP as well.
The versions of both the intellij plugin and the google-java-format version in spotless are the same, so it's unlikely this is a version discrepancy.
Reformatting code in intellij makes the plugin report formatting issues:
[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.39.0:check (default) on project template-spring-boot: The following files had format violations:
[ERROR] src/main/java/no/wlcm/tech/config/OpenApiConfig.java
[ERROR] @@ -6,12 +6,10 @@
[ERROR] import·io.swagger.v3.oas.models.security.SecurityRequirement;
[ERROR] import·io.swagger.v3.oas.models.security.SecurityScheme;
[ERROR] import·io.swagger.v3.oas.models.servers.Server;
[ERROR] -
[ERROR] +import·java.util.stream.Stream;
[ERROR] import·org.springframework.context.annotation.Bean;
[ERROR] import·org.springframework.context.annotation.Configuration;
[ERROR]
[ERROR] -import·java.util.stream.Stream;
[ERROR] -
[ERROR] @Configuration
[ERROR] public·class·OpenApiConfig·{
[ERROR]
[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
This is also the diff after running mvn spotless:apply
As an extra test, I downloaded the google-java-format jar for v1.21.0 ran java -jar /tmp/google-java-format-1.21.0-all-deps.jar -r --aosp OpenApiConfig.java and it does no modifications after reformatting with intellij plugin:
The text was updated successfully, but these errors were encountered:
serpro69
changed the title
Maven: Inconsistent behavior between google java style of plugin and intellij
Maven: Inconsistent behavior between formatting Java (google AOSP style) with plugin and intellij
Mar 19, 2024
serpro69
changed the title
Maven: Inconsistent behavior between formatting Java (google AOSP style) with plugin and intellij
Maven: Inconsistent formatting of Java (google AOSP style) with plugin and intellij
Mar 19, 2024
serpro69
changed the title
Maven: Inconsistent formatting of Java (google AOSP style) with plugin and intellij
Maven: Inconsistent formatting of Java (google AOSP style) with plugin and google-java-format.jar
Mar 19, 2024
Summary
I have google-java-format intellij plugin installed and configured to use AOSP style, and spotless maven plugin that is configured with AOSP as well.
The versions of both the intellij plugin and the google-java-format version in spotless are the same, so it's unlikely this is a version discrepancy.
Reformatting code in intellij makes the plugin report formatting issues:
This is also the diff after running
mvn spotless:apply
As an extra test, I downloaded the google-java-format jar for v1.21.0 ran
java -jar /tmp/google-java-format-1.21.0-all-deps.jar -r --aosp OpenApiConfig.java
and it does no modifications after reformatting with intellij plugin:So this hints at the spotless plugin, either something it does beyond applying google-java-format, misconfiguration or?
System Info
Plugin Info
Tried to minimize the java format configuration to:
but that produces the same results
The text was updated successfully, but these errors were encountered: