Skip to content

Commit

Permalink
fix: createStagingRepository should always create staging-repo-ids.pr…
Browse files Browse the repository at this point in the history
…operties into rootProject's build dir
  • Loading branch information
gciatto authored and DanySK committed Jul 3, 2023
1 parent ac5bffd commit 56aeb21
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,16 @@ internal object ProjectExtensions {
"createStagingRepositoryOn$repoName",
) {
val stagingRepoIdsFileName = "staging-repo-ids.properties"
outputs.file(buildDir.resolve(stagingRepoIdsFileName))
val stagingRepoIdsFile = rootProject.buildDir.resolve(stagingRepoIdsFileName)
outputs.file(rootProject.buildDir.resolve(stagingRepoIdsFileName))
dependsOn(nexusClient)
doLast {
rootProject.warnIfCredentialsAreMissing(repoToConfigure)
nexusClient.nexusClient.repoUrl // triggers the initialization of a repository
val repoId = nexusClient.nexusClient.repoId
// Write the staging repository ID to build/staging-repo-ids.properties file
buildDir.resolve(stagingRepoIdsFileName).appendText(
"$repoName=${nexusClient.nexusClient.repoId}" + System.lineSeparator(),
)
stagingRepoIdsFile.appendText("$repoName=$repoId" + System.lineSeparator())
logger.lifecycle("Append repo name {} to file {}", repoId, stagingRepoIdsFile.path)
}
group = PublishingPlugin.PUBLISH_TASK_GROUP
description = "Creates a new Nexus staging repository on $repoName."
Expand Down

0 comments on commit 56aeb21

Please sign in to comment.