Add Release Train Integration
This commit adds the build-level configuration required for release train participation. See gh-19518
This commit is contained in:
@@ -13,6 +13,16 @@ repositories {
|
||||
gradlePluginPortal()
|
||||
mavenCentral()
|
||||
maven { url = 'https://repo.spring.io/snapshot' }
|
||||
if (System.getenv("RELEASE_TRAIN_MAVEN_REPOSITORY_URL") != null) {
|
||||
maven {
|
||||
name = "Release Train"
|
||||
url = System.getenv("RELEASE_TRAIN_MAVEN_REPOSITORY_URL")
|
||||
credentials {
|
||||
username = System.getenv("RELEASE_TRAIN_MAVEN_REPOSITORY_USERNAME")
|
||||
password = System.getenv("RELEASE_TRAIN_MAVEN_REPOSITORY_PASSWORD")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
||||
+10
@@ -43,6 +43,16 @@ class RepositoryConventionPlugin implements Plugin<Project> {
|
||||
}
|
||||
}
|
||||
mavenCentral()
|
||||
if (System.getenv("RELEASE_TRAIN_MAVEN_REPOSITORY_URL") != null) {
|
||||
maven {
|
||||
name = "Release Train"
|
||||
url = System.getenv("RELEASE_TRAIN_MAVEN_REPOSITORY_URL")
|
||||
credentials {
|
||||
username = System.getenv("RELEASE_TRAIN_MAVEN_REPOSITORY_USERNAME")
|
||||
password = System.getenv("RELEASE_TRAIN_MAVEN_REPOSITORY_PASSWORD")
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isSnapshot) {
|
||||
maven {
|
||||
name = 'artifactory-snapshot'
|
||||
|
||||
+6
@@ -22,6 +22,12 @@ public class MavenPublishingConventionsPlugin implements Plugin<Project> {
|
||||
@Override
|
||||
public void execute(MavenPublishPlugin mavenPublish) {
|
||||
PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class);
|
||||
if (project.hasProperty("deploymentRepository")) {
|
||||
publishing.getRepositories().maven((mavenRepository) -> {
|
||||
mavenRepository.setUrl(project.property("deploymentRepository"));
|
||||
mavenRepository.setName("deployment");
|
||||
});
|
||||
}
|
||||
publishing.getPublications().withType(MavenPublication.class)
|
||||
.all((mavenPublication) -> MavenPublishingConventionsPlugin.this.customizePom(mavenPublication.getPom(), project));
|
||||
MavenPublishingConventionsPlugin.this.customizeJavaPlugin(project);
|
||||
|
||||
Reference in New Issue
Block a user