发布由 sbt-native-packager 创建的 zip [英] Publish zip created by sbt-native-packager

查看:39
本文介绍了发布由 sbt-native-packager 创建的 zip的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过 universal:packageBin 任务将 sbt-native-packager 插件生成的 zip 文件发布到存储库.

I am trying to publish to a repository the zip file generated by the sbt-native-packager plugin through universal:packageBin task.

我这样配置我的项目:

publishTo := Some("Repo" at "http://repo")

publishMavenStyle := true

packagerSettings

packageArchetype.java_application

我正在努力尝试使用发布任务和 packageBin 任务来创建一个新的 sbt 任务(名为 publishZip)来发布 zip 文件.我怎样才能做到这一点?

I am struggling trying to create a new sbt task (named publishZip) using publish task and packageBin task to publish the zip file. How can I achieve this ?

推荐答案

将以下行添加到您的 sbt 构建中(围绕 packagerSettings 应该没问题)

Add the following line to your sbt build (around packagerSettings should be fine)

deploymentSettings

根据您想要做什么,您可能不需要定义可以运行的 publishZip 任务

Depending on what you want to do you may not need to define the publishZip task you could run

  • sbt Universal:publish 应该只发布 zip
  • 重新定义发布,因此它依赖于通用:发布将发布所有项目工件publish <<= publish.dependsOn(publish in config("universal"))
  • sbt universal:publish which should only publish the zip
  • redefine publish so it depends on universal:publish which would publish all the projects artifacts publish <<= publish.dependsOn(publish in config("universal"))

然后运行 ​​sbt publish.

Then run sbt publish.

为了完整起见 deploymentSettings(和 packagerSettings)来自 com.typesafe.sbt.SbtNativePackager 这有助于了解您是否使用Scala 构建 :)

For completeness sake deploymentSettings (and packagerSettings) come from com.typesafe.sbt.SbtNativePackager which is useful to know if you use a scala build :)

这篇关于发布由 sbt-native-packager 创建的 zip的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆