diff --git a/src/main/scala/com/typesafe/sbt/packager/SettingsHelper.scala b/src/main/scala/com/typesafe/sbt/packager/SettingsHelper.scala index 0d7ce7837..f4fec6e66 100644 --- a/src/main/scala/com/typesafe/sbt/packager/SettingsHelper.scala +++ b/src/main/scala/com/typesafe/sbt/packager/SettingsHelper.scala @@ -23,18 +23,20 @@ object SettingsHelper { ivyModule <<= (ivySbt, moduleSettings) map { (i, s) => new i.Module(s) }, deliverLocalConfiguration <<= (crossTarget, ivyLoggingLevel) map { (outDir, level) => Classpaths.deliverConfig(outDir, logging = level) }, deliverConfiguration <<= deliverLocalConfiguration, - publishConfiguration <<= (packagedArtifacts, checksums, publishTo) map { (as, checks, publishTo) => + publishConfiguration <<= (packagedArtifacts, checksums, publishTo, isSnapshot) map { (as, checks, publishTo, isSnap) => new PublishConfiguration(ivyFile = None, resolverName = Classpaths.getPublishTo(publishTo).name, artifacts = as, checksums = checks, - logging = UpdateLogging.DownloadOnly) + logging = UpdateLogging.DownloadOnly, + overwrite = isSnap) }, - publishLocalConfiguration <<= (packagedArtifacts, checksums) map { (as, checks) => + publishLocalConfiguration <<= (packagedArtifacts, checksums, isSnapshot) map { (as, checks, isSnap) => new PublishConfiguration(ivyFile = None, resolverName = "local", artifacts = as, checksums = checks, - logging = UpdateLogging.DownloadOnly) + logging = UpdateLogging.DownloadOnly, + overwrite = isSnap) })) ++ addPackage(config, packageTask, extension) } \ No newline at end of file diff --git a/src/sbt-test/universal/publish/build.sbt b/src/sbt-test/universal/publish/build.sbt new file mode 100644 index 000000000..3e4cc1b36 --- /dev/null +++ b/src/sbt-test/universal/publish/build.sbt @@ -0,0 +1,14 @@ +import NativePackagerKeys._ + +packagerSettings + +deploymentSettings + +name := "simple-test" + +version := "0.1.0" + +// Workarund for ivy configuration bug +resolvers += (publishTo in Universal).value.get + +publishTo in Universal := Some(Resolver.file("test", file("test-repo"))(Patterns("[module]/[revision]/[module]-[revision].[ext]"))) \ No newline at end of file diff --git a/src/sbt-test/universal/publish/project/plugins.sbt b/src/sbt-test/universal/publish/project/plugins.sbt new file mode 100644 index 000000000..b53de154c --- /dev/null +++ b/src/sbt-test/universal/publish/project/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % sys.props("project.version")) diff --git a/src/sbt-test/universal/publish/src/universal/LICENSE b/src/sbt-test/universal/publish/src/universal/LICENSE new file mode 100644 index 000000000..b2fa782bc --- /dev/null +++ b/src/sbt-test/universal/publish/src/universal/LICENSE @@ -0,0 +1 @@ +DUMMY! \ No newline at end of file diff --git a/src/sbt-test/universal/publish/test b/src/sbt-test/universal/publish/test new file mode 100644 index 000000000..ed9df0740 --- /dev/null +++ b/src/sbt-test/universal/publish/test @@ -0,0 +1,4 @@ +# Ensure we can publish to local file system. +> universal:publish +# Ensure isSnpashot works correctly +> universal:publish \ No newline at end of file