1
0
mirror of synced 2026-08-24 02:57:08 +00:00

Add Release Train Integration

This commit adds the build-level configuration required for
release train participation.

See gh-19518
This commit is contained in:
Josh Cummings
2026-07-08 16:40:34 -06:00
parent f03e612a14
commit 36e7420bd0
3 changed files with 26 additions and 0 deletions
+10
View File
@@ -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 {
@@ -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'
@@ -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);