From 15685b3b5aba4fc9dd3e62796146c486dcc29c80 Mon Sep 17 00:00:00 2001 From: Joe Grandja Date: Wed, 28 Feb 2024 08:19:16 -0500 Subject: [PATCH] Polish gh-1535 --- buildSrc/build.gradle | 4 ++-- .../checkstyle/SpringJavaCheckstylePlugin.java | 4 ++-- .../gradle/maven/SpringArtifactoryPlugin.java | 12 ++++++------ .../gradle/maven/SpringPublishLocalPlugin.java | 2 +- gradle.properties | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 11de7e57..7808ced9 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -16,8 +16,8 @@ repositories { dependencies { implementation "com.github.ben-manes:gradle-versions-plugin:0.38.0" - implementation "io.github.gradle-nexus:publish-plugin:2.0.0-rc-2" - implementation "io.spring.javaformat:spring-javaformat-gradle-plugin:0.0.41" + implementation "io.github.gradle-nexus:publish-plugin:1.1.0" + implementation "io.spring.javaformat:spring-javaformat-gradle-plugin:0.0.31" implementation "io.spring.nohttp:nohttp-gradle:0.0.11" implementation "org.asciidoctor:asciidoctor-gradle-jvm:3.3.2" implementation "org.asciidoctor:asciidoctor-gradle-jvm-pdf:3.3.2" diff --git a/buildSrc/src/main/java/org/springframework/gradle/checkstyle/SpringJavaCheckstylePlugin.java b/buildSrc/src/main/java/org/springframework/gradle/checkstyle/SpringJavaCheckstylePlugin.java index 1b482b0b..19c5e930 100644 --- a/buildSrc/src/main/java/org/springframework/gradle/checkstyle/SpringJavaCheckstylePlugin.java +++ b/buildSrc/src/main/java/org/springframework/gradle/checkstyle/SpringJavaCheckstylePlugin.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ import org.gradle.api.plugins.quality.CheckstylePlugin; public class SpringJavaCheckstylePlugin implements Plugin { private static final String CHECKSTYLE_DIR = "etc/checkstyle"; private static final String SPRING_JAVAFORMAT_VERSION_PROPERTY = "springJavaformatVersion"; - private static final String DEFAULT_SPRING_JAVAFORMAT_VERSION = "0.0.41"; + private static final String DEFAULT_SPRING_JAVAFORMAT_VERSION = "0.0.31"; private static final String NOHTTP_CHECKSTYLE_VERSION_PROPERTY = "nohttpCheckstyleVersion"; private static final String DEFAULT_NOHTTP_CHECKSTYLE_VERSION = "0.0.11"; private static final String CHECKSTYLE_TOOL_VERSION_PROPERTY = "checkstyleToolVersion"; diff --git a/buildSrc/src/main/java/org/springframework/gradle/maven/SpringArtifactoryPlugin.java b/buildSrc/src/main/java/org/springframework/gradle/maven/SpringArtifactoryPlugin.java index b0ecc8a5..85226e45 100644 --- a/buildSrc/src/main/java/org/springframework/gradle/maven/SpringArtifactoryPlugin.java +++ b/buildSrc/src/main/java/org/springframework/gradle/maven/SpringArtifactoryPlugin.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,8 +36,6 @@ public class SpringArtifactoryPlugin implements Plugin { // Apply artifactory repository configuration boolean isSnapshot = ProjectUtils.isSnapshot(project); boolean isMilestone = ProjectUtils.isMilestone(project); - String artifactoryUsername = (String) project.findProperty("artifactoryUsername"); - String artifactoryPassword = (String) project.findProperty("artifactoryPassword"); ArtifactoryPluginConvention artifactoryExtension = project.getExtensions().getByType(ArtifactoryPluginConvention.class); artifactoryExtension.publish((publish) -> { @@ -46,12 +44,14 @@ public class SpringArtifactoryPlugin implements Plugin { String repoKey = isSnapshot ? "libs-snapshot-local" : isMilestone ? "libs-milestone-local" : "libs-release-local"; repository.setRepoKey(repoKey); if (project.hasProperty("artifactoryUsername")) { - repository.setUsername(artifactoryUsername); - repository.setPassword(artifactoryPassword); + repository.setUsername((String) project.findProperty("artifactoryUsername")); + repository.setPassword((String) project.findProperty("artifactoryPassword")); } }); // Would fail if maven publish is not applied, i.e. in root project (SpringRootProjectPlugin) - project.getPlugins().withType(MavenPublishPlugin.class, mavenPublish -> publish.defaults((defaults) -> defaults.publications("mavenJava"))); + project.getPlugins().withType(MavenPublishPlugin.class, mavenPublish -> { + publish.defaults((defaults) -> defaults.publications("mavenJava")); + }); }); } } diff --git a/buildSrc/src/main/java/org/springframework/gradle/maven/SpringPublishLocalPlugin.java b/buildSrc/src/main/java/org/springframework/gradle/maven/SpringPublishLocalPlugin.java index 3828bc5f..aeac1bec 100644 --- a/buildSrc/src/main/java/org/springframework/gradle/maven/SpringPublishLocalPlugin.java +++ b/buildSrc/src/main/java/org/springframework/gradle/maven/SpringPublishLocalPlugin.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gradle.properties b/gradle.properties index f7e6c379..88e062cd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ org.gradle.parallel=true org.gradle.caching=true springFrameworkVersion=6.1.3 springSecurityVersion=6.3.0-M1 -springJavaformatVersion=0.0.41 +springJavaformatVersion=0.0.38 springJavaformatExcludePackages=org/springframework/security/config org/springframework/security/oauth2 checkstyleToolVersion=8.34 nohttpCheckstyleVersion=0.0.11