13
0
geforkt von Mirrors/Velocity

This should do it

Dieser Commit ist enthalten in:
Andrew Steinborn 2018-08-21 23:58:17 -04:00
Ursprung 13215f132e
Commit f6f48e9b2d

Datei anzeigen

@ -58,19 +58,13 @@ publishing {
} }
} }
println "maven deployment: ${System.getenv("MAVEN_DEPLOYMENT")}"
println "on branch ${project.ext.getCurrentBranchName()}"
if (System.getenv("MAVEN_DEPLOYMENT") != null && project.ext.getCurrentBranchName() == "master") {
repositories { repositories {
maven { maven {
name = 'myRepo' name = 'myRepo'
if (project.version.toString().endsWith("-SNAPSHOT")) { def base = project.ext.getCurrentBranchName() == "master" ? File.createTempDir().toURI().toURL().toString() : 'file:///maven-repo'
url = "file:///maven-repo/snapshots" def releasesRepoUrl = "$base/releases"
} else { def snapshotsRepoUrl = "$base/snapshots"
url = "file:///maven-repo/releases" url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
} }
} }
} }