Update to Gradle 8.6
Closes gh-1535
This commit is contained in:
committed by
Joe Grandja
parent
2004ba10e2
commit
a05d89d3c6
@@ -37,9 +37,9 @@ 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.31";
|
||||
private static final String DEFAULT_SPRING_JAVAFORMAT_VERSION = "0.0.41";
|
||||
private static final String NOHTTP_CHECKSTYLE_VERSION_PROPERTY = "nohttpCheckstyleVersion";
|
||||
private static final String DEFAULT_NOHTTP_CHECKSTYLE_VERSION = "0.0.10";
|
||||
private static final String DEFAULT_NOHTTP_CHECKSTYLE_VERSION = "0.0.11";
|
||||
private static final String CHECKSTYLE_TOOL_VERSION_PROPERTY = "checkstyleToolVersion";
|
||||
private static final String DEFAULT_CHECKSTYLE_TOOL_VERSION = "8.34";
|
||||
private static final String SPRING_JAVAFORMAT_EXCLUDE_PACKAGES_PROPERTY = "springJavaformatExcludePackages";
|
||||
|
||||
@@ -36,25 +36,22 @@ 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");
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
ArtifactoryPluginConvention artifactoryExtension = project.getConvention().getPlugin(ArtifactoryPluginConvention.class);
|
||||
artifactoryExtension.artifactory((artifactory) -> {
|
||||
artifactory.setContextUrl("https://repo.spring.io");
|
||||
artifactory.publish((publish) -> {
|
||||
publish.repository((repository) -> {
|
||||
String repoKey = isSnapshot ? "libs-snapshot-local" : isMilestone ? "libs-milestone-local" : "libs-release-local";
|
||||
repository.setRepoKey(repoKey);
|
||||
if (project.hasProperty("artifactoryUsername")) {
|
||||
repository.setUsername(project.findProperty("artifactoryUsername"));
|
||||
repository.setPassword(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"));
|
||||
});
|
||||
ArtifactoryPluginConvention artifactoryExtension = project.getExtensions().getByType(ArtifactoryPluginConvention.class);
|
||||
artifactoryExtension.publish((publish) -> {
|
||||
publish.setContextUrl("https://repo.spring.io");
|
||||
publish.repository((repository) -> {
|
||||
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);
|
||||
}
|
||||
});
|
||||
// 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")));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class SpringPublishLocalPlugin implements Plugin<Project> {
|
||||
PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class);
|
||||
publishing.getRepositories().maven((maven) -> {
|
||||
maven.setName("local");
|
||||
maven.setUrl(new File(project.getRootProject().getBuildDir(), "publications/repos"));
|
||||
maven.setUrl(new File(project.getRootProject().getLayout().getBuildDirectory().getAsFile().get(), "publications/repos"));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user