Skip to content

Conversation

@dreis2211
Copy link
Contributor

@dreis2211 dreis2211 commented Dec 5, 2019

Hi,

this PR fixes a couple of more checkstyle issues caused by #19287. There was a commit by @wilkinsona that already fixed the warnings inside the gradle plugin, but there are some more.

Cheers,
Christoph

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 5, 2019
@wilkinsona
Copy link
Member

Thanks very much, @dreis2211. What's currently confusing me is that ./mvnw -DskipTests verify builds cleanly without your changes and I can see that Checkstyle has run. For example:

[INFO] ------< org.springframework.boot:spring-boot-launch-script-tests >------
[INFO] Building Spring Boot Launch Script Integration Tests 2.2.2.BUILD-SNAPSHOT [89/89]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-checkstyle-plugin:3.0.0:check (checkstyle-validation) @ spring-boot-launch-script-tests ---

@wilkinsona
Copy link
Member

wilkinsona commented Dec 5, 2019

Furthering my confusion, only 8 problems were identified with the Gradle plugin:

[INFO] --- maven-checkstyle-plugin:3.0.0:check (checkstyle-validation) @ spring-boot-gradle-plugin ---
Downloading from central: https://repo.maven.apache.org/maven2/io/spring/javaformat/spring-javaformat-checkstyle/0.0.17/spring-javaformat-checkstyle-0.0.17.pom
Downloaded from central: https://repo.maven.apache.org/maven2/io/spring/javaformat/spring-javaformat-checkstyle/0.0.17/spring-javaformat-checkstyle-0.0.17.pom (0 B at 0 B/s)
Downloading from central: https://repo.maven.apache.org/maven2/io/spring/javaformat/spring-javaformat/0.0.17/spring-javaformat-0.0.17.pom
Downloaded from central: https://repo.maven.apache.org/maven2/io/spring/javaformat/spring-javaformat/0.0.17/spring-javaformat-0.0.17.pom (0 B at 0 B/s)
Downloading from central: https://repo.maven.apache.org/maven2/io/spring/javaformat/spring-javaformat-checkstyle/0.0.17/spring-javaformat-checkstyle-0.0.17.jar
Downloaded from central: https://repo.maven.apache.org/maven2/io/spring/javaformat/spring-javaformat-checkstyle/0.0.17/spring-javaformat-checkstyle-0.0.17.jar (0 B at 0 B/s)
[INFO] There are 8 errors reported by Checkstyle 8.22 with src/checkstyle/checkstyle.xml ruleset.
[ERROR] src/test/java/org/springframework/boot/gradle/docs/IntegratingWithActuatorDocumentationTests.java:[43,9] (extension) SpringJUnit5: Test method 'basicBuildInfo' should not be public.
[ERROR] src/test/java/org/springframework/boot/gradle/docs/IntegratingWithActuatorDocumentationTests.java:[50,9] (extension) SpringJUnit5: Test method 'buildInfoCustomValues' should not be public.
[ERROR] src/test/java/org/springframework/boot/gradle/docs/IntegratingWithActuatorDocumentationTests.java:[63,9] (extension) SpringJUnit5: Test method 'buildInfoAdditional' should not be public.
[ERROR] src/test/java/org/springframework/boot/gradle/docs/GettingStartedDocumentationTests.java:[39,9] (extension) SpringJUnit5: Test method 'typicalPluginsAppliesExceptedPlugins' should not be public.
[ERROR] src/test/java/org/springframework/boot/gradle/docs/ManagingDependenciesDocumentationTests.java:[40,9] (extension) SpringJUnit5: Test method 'dependenciesExampleEvaluatesSuccessfully' should not be public.
[ERROR] src/test/java/org/springframework/boot/gradle/docs/ManagingDependenciesDocumentationTests.java:[45,9] (extension) SpringJUnit5: Test method 'customManagedVersions' should not be public.
[ERROR] src/test/java/org/springframework/boot/gradle/docs/ManagingDependenciesDocumentationTests.java:[51,9] (extension) SpringJUnit5: Test method 'dependencyManagementInIsolation' should not be public.
[ERROR] src/test/java/org/springframework/boot/gradle/docs/ManagingDependenciesDocumentationTests.java:[57,9] (extension) SpringJUnit5: Test method 'dependencyManagementInIsolationWithPluginsBlock' should not be public.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.511 s
[INFO] Finished at: 2019-12-05T10:10:32Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.0.0:check (checkstyle-validation) on project spring-boot-gradle-plugin: You have 8 Checkstyle violations. -> [Help 1]

As 47b47c2 shows, there were in fact many more.

@wilkinsona
Copy link
Member

It looks like a problem with Checkstyle's cache that it writes into target. It doesn't invalidate the cache following the Spring Java Format upgrade. As a result, it doesn't apply the new rules to files that haven't changed since it was last run. A clean fixes this.

@wilkinsona wilkinsona added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 5, 2019
@wilkinsona wilkinsona modified the milestones: 2.2.x, 2.2.2 Dec 5, 2019
wilkinsona pushed a commit that referenced this pull request Dec 5, 2019
@wilkinsona wilkinsona closed this in dc8edde Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: task A general task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants