Polish gh-1535
This commit is contained in:
@@ -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<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";
|
||||
|
||||
@@ -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> {
|
||||
// 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> {
|
||||
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"));
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user