Skip to content

Commit

Permalink
Create nexus lazily to avoid an error when properties aren't set (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
eygraber committed Sep 5, 2022
1 parent 86b2c8f commit 5e48420
Showing 1 changed file with 7 additions and 5 deletions.
Expand Up @@ -19,11 +19,13 @@ internal abstract class SonatypeRepositoryBuildService : BuildService<SonatypeRe
val automaticRelease: Property<Boolean>
}

val nexus = Nexus(
baseUrl = parameters.sonatypeHost.get().apiBaseUrl(),
username = parameters.repositoryUsername.get(),
password = parameters.repositoryPassword.get(),
)
val nexus by lazy {
Nexus(
baseUrl = parameters.sonatypeHost.get().apiBaseUrl(),
username = parameters.repositoryUsername.get(),
password = parameters.repositoryPassword.get(),
)
}

// should only be accessed from CreateSonatypeRepositoryTask
// for all other use cases use MavenPublishBaseExtension
Expand Down

0 comments on commit 5e48420

Please sign in to comment.