Skip to content

Commit 8433a6b

Browse files
committed
Gradle: add informative message when deploying to Maven repository.
1 parent 332a7bc commit 8433a6b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

buildSrc/src/main/groovy/css4j.java-conventions.gradle

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ publishing {
124124
if (project.hasProperty('mavenReleaseRepoUrl') && project.mavenReleaseRepoUrl) {
125125
releasesUrl = mavenReleaseRepoUrl
126126
} else {
127-
releasesUrl = "${rootDir}/build/repository/releases"
127+
releasesUrl = "${buildDir}/repository/releases"
128128
}
129129
if (project.hasProperty('mavenSnapshotRepoUrl') && project.mavenSnapshotRepoUrl) {
130130
snapshotsUrl = mavenSnapshotRepoUrl
131131
} else {
132-
snapshotsUrl = "${rootDir}/build/repository/snapshots"
132+
snapshotsUrl = "${buildDir}/repository/snapshots"
133133
}
134134
url = version.endsWith('-SNAPSHOT') ? snapshotsUrl : releasesUrl
135135
if (project.hasProperty('mavenRepoUsername') &&
@@ -140,3 +140,11 @@ publishing {
140140
}
141141
}
142142
}
143+
144+
tasks.withType(PublishToMavenRepository) { task ->
145+
doFirst {
146+
if (repository == publishing.repositories.getByName('mavenRepo')) {
147+
logger.lifecycle "Deploying artifacts to \"${it.repository.url}\""
148+
}
149+
}
150+
}

0 commit comments

Comments
 (0)