diff options
Diffstat (limited to 'plugins/sonatype-release/src/sonatype')
-rw-r--r-- | plugins/sonatype-release/src/sonatype/SonatypeLib.scala | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/plugins/sonatype-release/src/sonatype/SonatypeLib.scala b/plugins/sonatype-release/src/sonatype/SonatypeLib.scala index 08f7ee1..4e5d613 100644 --- a/plugins/sonatype-release/src/sonatype/SonatypeLib.scala +++ b/plugins/sonatype-release/src/sonatype/SonatypeLib.scala @@ -54,7 +54,7 @@ final case class SonatypeLib( profileName: String, serviceURI: String = SonatypeLib.serviceURI, snapshotsURI: String = SonatypeLib.snapshotsURI, - credentials: String = SonatypeLib.credentials + credentials: String = SonatypeLib.credentials // FIXME: maybe hide this from cli ? )( implicit logger: Logger ){ private val lib: Lib = new Lib(logger) private def log: String => Unit = logger.log("sonatype-release",_) @@ -74,20 +74,21 @@ final case class SonatypeLib( artifacts, new URL(deployURI ++ releaseFolder), Some(credentials) ) - val urls = if (releaseFolder.endsWith("-SNAPSHOT")){ - publish(snapshotsURI) + if (releaseFolder.endsWith("-SNAPSHOT")){ + val urls = publish(snapshotsURI) + System.err.println(lib.green("Successfully published snapshot on Sonatype!")) + urls } else { val profile = getStagingProfile val repoId = createStagingRepo(profile) val urls = publish( serviceURI ++ "/staging/deployByRepositoryId/" ++ repoId.string ) + System.err.println(lib.green("Successfully uploaded jars to Sonatype!")) finishRelease( getStagingRepoById(repoId), profile ) - urls + System.err.println(lib.green("Successfully released uploaded jars to Maven Central!")) + urls } - - System.err.println(lib.green("Successfully published to Sonatype!")) - urls } /* @@ -101,6 +102,8 @@ final case class SonatypeLib( private def release: ExitCode = { val profile = getStagingProfile() + System.err.println("Releasing jars to Maven Central!") + getStagingRepos(profile).toList match { case Nil => System.err.println(lib.red("No staging repositories found, you need to publish artifacts first.")) |