Skip to content

Commit

Permalink
feat: add option to publish to external repo (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgressa authored Sep 27, 2021
1 parent 29b828c commit aa270cf
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,35 @@ class MicronautPublishingPlugin implements Plugin<Project> {

publishing {
repositories {
def externalRepo = providers.systemProperty("io.micronaut.publishing.uri")
.forUseAtConfigurationTime()
.orNull
if (externalRepo) {

def externalRepoUsername = providers.systemProperty("io.micronaut.publishing.username")
.forUseAtConfigurationTime()
.orNull
def externalRepoPassword = providers.systemProperty("io.micronaut.publishing.password")
.forUseAtConfigurationTime()
.orNull

maven {
name = "External"
url = externalRepo
if(externalRepoUsername){
credentials {
username = externalRepoUsername
password = externalRepoPassword
}
}
}
}

maven {
name = "Build"
url = "${rootProject.layout.buildDirectory.dir("repo").get().asFile.toURI()}"
}

}
publications {
if (project.extensions.findByType(PublishingExtension).publications.empty) {
Expand Down

0 comments on commit aa270cf

Please sign in to comment.