Skip to content

Commit aa9309a

Browse files
dlvenableJonah Calvo
authored andcommitted
Gradle build support for publishing Maven snapshots. Updates the release.yml to publish only the Maven release artifacts. (opensearch-project#5797)
Signed-off-by: David Venable <dlv@amazon.com> Signed-off-by: Jonah Calvo <caljonah@amazon.com>
1 parent 43edf8f commit aa9309a

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
run: ./gradlew --parallel --max-workers 2 :release:archives:buildArchives
4646

4747
- name: Build Maven Artifacts
48-
run: ./gradlew publish
48+
run: ./gradlew publishAllPublicationsToMavenRepository
4949

5050
- name: Build Docker Image
5151
run: ./gradlew :release:docker:docker

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ allprojects {
2222
apply plugin: 'com.github.jk1.dependency-license-report'
2323

2424
ext {
25-
mavenPublicationRootFile = file("${rootProject.buildDir}/m2")
25+
mavenPublicationRootFile = file(rootProject.layout.buildDirectory.dir('m2'))
2626
}
2727

2828
spotless {

buildSrc/src/main/groovy/data-prepper.publish.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ afterEvaluate {
1515
maven {
1616
url "file://${mavenPublicationRootFile.absolutePath}"
1717
}
18+
maven {
19+
name = 'snapshots'
20+
url = 'https://aws.oss.sonatype.org/content/repositories/snapshots'
21+
credentials {
22+
username "$System.env.SONATYPE_USERNAME"
23+
password "$System.env.SONATYPE_PASSWORD"
24+
}
25+
}
1826
}
1927
publications {
2028
mavenJava(MavenPublication) {

0 commit comments

Comments
 (0)