Browse Source

Polish gh-1535

pull/1548/head
Joe Grandja 2 years ago
parent
commit
15685b3b5a
  1. 4
      buildSrc/build.gradle
  2. 4
      buildSrc/src/main/java/org/springframework/gradle/checkstyle/SpringJavaCheckstylePlugin.java
  3. 12
      buildSrc/src/main/java/org/springframework/gradle/maven/SpringArtifactoryPlugin.java
  4. 2
      buildSrc/src/main/java/org/springframework/gradle/maven/SpringPublishLocalPlugin.java
  5. 2
      gradle.properties

4
buildSrc/build.gradle

@ -16,8 +16,8 @@ repositories { @@ -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"

4
buildSrc/src/main/java/org/springframework/gradle/checkstyle/SpringJavaCheckstylePlugin.java

@ -1,5 +1,5 @@ @@ -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; @@ -37,7 +37,7 @@ import org.gradle.api.plugins.quality.CheckstylePlugin;
public class SpringJavaCheckstylePlugin implements Plugin<Project> {
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";

12
buildSrc/src/main/java/org/springframework/gradle/maven/SpringArtifactoryPlugin.java

@ -1,5 +1,5 @@ @@ -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<Project> { @@ -36,8 +36,6 @@ public class SpringArtifactoryPlugin implements Plugin<Project> {
// 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<Project> { @@ -46,12 +44,14 @@ public class SpringArtifactoryPlugin implements Plugin<Project> {
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"));
});
});
}
}

2
buildSrc/src/main/java/org/springframework/gradle/maven/SpringPublishLocalPlugin.java

@ -1,5 +1,5 @@ @@ -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.

2
gradle.properties

@ -4,7 +4,7 @@ org.gradle.parallel=true @@ -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

Loading…
Cancel
Save