mirror of https://github.com/sbt/sbt.git
Merge pull request #1300 from cunei/wip-fix-ivy-move
Do not attempt to publish if no artifacts are present
This commit is contained in:
commit
c855dbd854
|
|
@ -255,16 +255,18 @@ object IvyActions
|
||||||
|
|
||||||
def publish(module: ModuleDescriptor, artifacts: Seq[(IArtifact, File)], resolver: DependencyResolver, overwrite: Boolean): Unit =
|
def publish(module: ModuleDescriptor, artifacts: Seq[(IArtifact, File)], resolver: DependencyResolver, overwrite: Boolean): Unit =
|
||||||
{
|
{
|
||||||
checkFilesPresent(artifacts)
|
if (artifacts.nonEmpty) {
|
||||||
try {
|
checkFilesPresent(artifacts)
|
||||||
resolver.beginPublishTransaction(module.getModuleRevisionId(), overwrite);
|
try {
|
||||||
for( (artifact, file) <- artifacts)
|
resolver.beginPublishTransaction(module.getModuleRevisionId(), overwrite);
|
||||||
resolver.publish(artifact, file, overwrite)
|
for( (artifact, file) <- artifacts)
|
||||||
resolver.commitPublishTransaction()
|
resolver.publish(artifact, file, overwrite)
|
||||||
} catch {
|
resolver.commitPublishTransaction()
|
||||||
case e: Throwable =>
|
} catch {
|
||||||
try { resolver.abortPublishTransaction() }
|
case e: Throwable =>
|
||||||
finally { throw e }
|
try { resolver.abortPublishTransaction() }
|
||||||
|
finally { throw e }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private[this] def checkFilesPresent(artifacts: Seq[(IArtifact, File)])
|
private[this] def checkFilesPresent(artifacts: Seq[(IArtifact, File)])
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue