@@ -281,13 +281,6 @@ object Build {
281281 // I find supershell more distracting than helpful
282282 useSuperShell := false ,
283283
284- // Credentials to release to Sonatype
285- credentials ++= (
286- for {
287- username <- sys.env.get(" SONATYPE_USER" )
288- password <- sys.env.get(" SONATYPE_PW" )
289- } yield Credentials (" Sonatype Nexus Repository Manager" , " central.sonatype.com" , username, password)
290- ).toList,
291284 PgpKeys .pgpPassphrase := sys.env.get(" PGP_PW" ).map(_.toCharArray()),
292285 PgpKeys .useGpgPinentry := true ,
293286
@@ -1929,10 +1922,27 @@ object Build {
19291922 publishMavenStyle := true ,
19301923 isSnapshot := version.value.contains(" SNAPSHOT" ),
19311924 publishTo := {
1932- val centralSnapshots = " https://central.sonatype.com/repository/maven-snapshots/"
1933- if (isSnapshot.value) Some (" central-snapshots" at centralSnapshots)
1934- else localStaging.value
1925+ if (sys.env.get(" NEWNIGHTLY" ).contains(" yes" )) {
1926+ Some (sys.env(" MAVEN_REPOSITORY_REALM" ) at sys.env(" MAVEN_REPOSITORY_URL" ))
1927+ } else if (isSnapshot.value) {
1928+ Some (" central-snapshots" at " https://central.sonatype.com/repository/maven-snapshots/" )
1929+ } else
1930+ localStaging.value
19351931 },
1932+ credentials ++= (
1933+ if (sys.env.get(" NEWNIGHTLY" ).contains(" yes" )) {
1934+ for {
1935+ username <- sys.env.get(" MAVEN_REPOSITORY_USER" )
1936+ token <- sys.env.get(" MAVEN_REPOSITORY_TOKEN" )
1937+ } yield Credentials (sys.env(" MAVEN_REPOSITORY_REALM" ), sys.env(" MAVEN_REPOSITORY_HOST" ), username, token)
1938+ }
1939+ else
1940+ for {
1941+ username <- sys.env.get(" SONATYPE_USER" )
1942+ password <- sys.env.get(" SONATYPE_PW" )
1943+ } yield Credentials (" Sonatype Nexus Repository Manager" , " central.sonatype.com" , username, password)
1944+
1945+ ).toList,
19361946 publishConfiguration ~= (_.withOverwrite(true )),
19371947 publishLocalConfiguration ~= (_.withOverwrite(true )),
19381948 projectID ~= {id =>
0 commit comments