- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有几个项目。我使用 publishLocal
来更新本地存储库。有时我会并行处理其中几个,但我不想继续更新版本号。
所以我使用 publishLocal
工作正常,但它发出此警告
[warn] This usage is deprecated and will be removed in sbt 1.0.
[warn] Attempting to overwrite /home/tim/.ivy2/local/com.optrak/vrpmodel_2.11/0.8.3/ivys/ivy.xml.sha1
所以想必我应该使用其他东西。但什么?
最佳答案
一切都始于 a workaround for #1156上面写着(在 #1156 中):
Basically, as of sbt 0.13.2 you can no longer republish a release if it already exists. This is quite a dangerous thing to do because it leads to broken caches all over. Only -SNAPSHOTs are allowed to be republished.
这意味着您publishLocal
是一个稳定版本,而不是SNAPSHOT
,并且首选选项是不覆盖稳定版本。
作为解决方法,您可以使用 isSnapshot := true
,如 @jsuereth's comment 中所确认的那样:
isSnapshot, currently, only denotes that the build can overwrite previous values.
我自己也用以下 build.sbt
确认了这一点:
version := "1.0.0"
查看 session :
➜ stable-version-published-twice xsbt
JAVA_HOME=/Library/Java/JavaVirtualMachines/java8/Contents/Home
SBT_OPTS= -Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -Dfile.encoding=UTF-8
[info] Loading global plugins from /Users/jacek/.sbt/0.13/plugins
[info] Updating {file:/Users/jacek/.sbt/0.13/plugins/}global-plugins...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Set current project to stable-version-published-twice (in build file:/Users/jacek/sandbox/stable-version-published-twice/)
> show version
[info] 1.0.0
您可能已经注意到该项目的版本为 1.0.0
。这是第一个 publishLocal
。
> publishLocal
[info] Updating {file:/Users/jacek/sandbox/stable-version-published-twice/}stable-version-published-twice...
[info] Packaging /Users/jacek/sandbox/stable-version-published-twice/target/scala-2.10/stable-version-published-twice_2.10-1.0.0-sources.jar ...
[info] Done packaging.
[info] Wrote /Users/jacek/sandbox/stable-version-published-twice/target/scala-2.10/stable-version-published-twice_2.10-1.0.0.pom
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] :: delivering :: default#stable-version-published-twice_2.10;1.0.0 :: 1.0.0 :: release :: Sun Sep 28 22:46:10 CEST 2014
[info] delivering ivy file to /Users/jacek/sandbox/stable-version-published-twice/target/scala-2.10/ivy-1.0.0.xml
[info] Packaging /Users/jacek/sandbox/stable-version-published-twice/target/scala-2.10/stable-version-published-twice_2.10-1.0.0-javadoc.jar ...
[info] Done packaging.
[info] Packaging /Users/jacek/sandbox/stable-version-published-twice/target/scala-2.10/stable-version-published-twice_2.10-1.0.0.jar ...
[info] Done packaging.
[info] published stable-version-published-twice_2.10 to /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/poms/stable-version-published-twice_2.10.pom
[info] published stable-version-published-twice_2.10 to /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/jars/stable-version-published-twice_2.10.jar
[info] published stable-version-published-twice_2.10 to /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/srcs/stable-version-published-twice_2.10-sources.jar
[info] published stable-version-published-twice_2.10 to /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/docs/stable-version-published-twice_2.10-javadoc.jar
[info] published ivy to /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/ivys/ivy.xml
[success] Total time: 0 s, completed Sep 28, 2014 10:46:10 PM
一切顺利(正如预期的那样)。这是另一个 publishLocal
(应该会成功,但会出现警告 - 此用法已被弃用,并将在 sbt 1.0 中删除。
- 因为我们正在重新发布稳定版本)。
> publishLocal
[info] Wrote /Users/jacek/sandbox/stable-version-published-twice/target/scala-2.10/stable-version-published-twice_2.10-1.0.0.pom
[info] :: delivering :: default#stable-version-published-twice_2.10;1.0.0 :: 1.0.0 :: release :: Sun Sep 28 22:46:18 CEST 2014
[info] delivering ivy file to /Users/jacek/sandbox/stable-version-published-twice/target/scala-2.10/ivy-1.0.0.xml
[warn] Attempting to overwrite /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/poms/stable-version-published-twice_2.10.pom
[warn] This usage is deprecated and will be removed in sbt 1.0.
[warn] Attempting to overwrite /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/poms/stable-version-published-twice_2.10.pom.sha1
[warn] This usage is deprecated and will be removed in sbt 1.0.
[warn] Attempting to overwrite /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/poms/stable-version-published-twice_2.10.pom.md5
[warn] This usage is deprecated and will be removed in sbt 1.0.
[info] published stable-version-published-twice_2.10 to /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/poms/stable-version-published-twice_2.10.pom
[warn] Attempting to overwrite /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/jars/stable-version-published-twice_2.10.jar
[warn] This usage is deprecated and will be removed in sbt 1.0.
[warn] Attempting to overwrite /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/jars/stable-version-published-twice_2.10.jar.sha1
[warn] This usage is deprecated and will be removed in sbt 1.0.
[warn] Attempting to overwrite /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/jars/stable-version-published-twice_2.10.jar.md5
[warn] This usage is deprecated and will be removed in sbt 1.0.
[info] published stable-version-published-twice_2.10 to /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/jars/stable-version-published-twice_2.10.jar
[warn] Attempting to overwrite /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/srcs/stable-version-published-twice_2.10-sources.jar
[warn] This usage is deprecated and will be removed in sbt 1.0.
[warn] Attempting to overwrite /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/srcs/stable-version-published-twice_2.10-sources.jar.sha1
[warn] This usage is deprecated and will be removed in sbt 1.0.
[warn] Attempting to overwrite /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/srcs/stable-version-published-twice_2.10-sources.jar.md5
[warn] This usage is deprecated and will be removed in sbt 1.0.
[info] published stable-version-published-twice_2.10 to /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/srcs/stable-version-published-twice_2.10-sources.jar
[warn] Attempting to overwrite /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/docs/stable-version-published-twice_2.10-javadoc.jar
[warn] This usage is deprecated and will be removed in sbt 1.0.
[warn] Attempting to overwrite /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/docs/stable-version-published-twice_2.10-javadoc.jar.sha1
[warn] This usage is deprecated and will be removed in sbt 1.0.
[warn] Attempting to overwrite /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/docs/stable-version-published-twice_2.10-javadoc.jar.md5
[warn] This usage is deprecated and will be removed in sbt 1.0.
[info] published stable-version-published-twice_2.10 to /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/docs/stable-version-published-twice_2.10-javadoc.jar
[warn] Attempting to overwrite /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/ivys/ivy.xml
[warn] This usage is deprecated and will be removed in sbt 1.0.
[warn] Attempting to overwrite /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/ivys/ivy.xml.sha1
[warn] This usage is deprecated and will be removed in sbt 1.0.
[warn] Attempting to overwrite /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/ivys/ivy.xml.md5
[warn] This usage is deprecated and will be removed in sbt 1.0.
[info] published ivy to /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/ivys/ivy.xml
[success] Total time: 0 s, completed Sep 28, 2014 10:46:18 PM
一切如预期进行。警告就在那里。
让我们将 isSnapshot
设置为 true
以将稳定版本表示为正在更改。
注意不过,我不建议这样做,因为构建中的其他一些代码可能依赖于正确的 isSnapshot
为 false
对于 1.0.0
。
> set isSnapshot := true
[info] Defining *:isSnapshot
[info] The new value will be used by *:deliverLocalConfiguration, *:publishConfiguration and 1 others.
[info] Run `last` for details.
[info] Reapplying settings...
[info] Set current project to stable-version-published-twice (in build file:/Users/jacek/sandbox/stable-version-published-twice/)
让我们再次publishLocal
稳定版本。
> publishLocal
[info] Wrote /Users/jacek/sandbox/stable-version-published-twice/target/scala-2.10/stable-version-published-twice_2.10-1.0.0.pom
[info] :: delivering :: default#stable-version-published-twice_2.10;1.0.0 :: 1.0.0 :: integration :: Sun Sep 28 22:46:44 CEST 2014
[info] delivering ivy file to /Users/jacek/sandbox/stable-version-published-twice/target/scala-2.10/ivy-1.0.0.xml
[info] published stable-version-published-twice_2.10 to /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/poms/stable-version-published-twice_2.10.pom
[info] published stable-version-published-twice_2.10 to /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/jars/stable-version-published-twice_2.10.jar
[info] published stable-version-published-twice_2.10 to /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/srcs/stable-version-published-twice_2.10-sources.jar
[info] published stable-version-published-twice_2.10 to /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/docs/stable-version-published-twice_2.10-javadoc.jar
[info] published ivy to /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/ivys/ivy.xml
[success] Total time: 0 s, completed Sep 28, 2014 10:46:44 PM
它没有任何警告。让我们再次尝试 publishLocal
。
> publishLocal
[info] Wrote /Users/jacek/sandbox/stable-version-published-twice/target/scala-2.10/stable-version-published-twice_2.10-1.0.0.pom
[info] :: delivering :: default#stable-version-published-twice_2.10;1.0.0 :: 1.0.0 :: integration :: Sun Sep 28 22:46:46 CEST 2014
[info] delivering ivy file to /Users/jacek/sandbox/stable-version-published-twice/target/scala-2.10/ivy-1.0.0.xml
[info] published stable-version-published-twice_2.10 to /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/poms/stable-version-published-twice_2.10.pom
[info] published stable-version-published-twice_2.10 to /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/jars/stable-version-published-twice_2.10.jar
[info] published stable-version-published-twice_2.10 to /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/srcs/stable-version-published-twice_2.10-sources.jar
[info] published stable-version-published-twice_2.10 to /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/docs/stable-version-published-twice_2.10-javadoc.jar
[info] published ivy to /Users/jacek/.ivy2/local/default/stable-version-published-twice_2.10/1.0.0/ivys/ivy.xml
[success] Total time: 0 s, completed Sep 28, 2014 10:46:46 PM
再次强调,没有警告 - 它按照广告宣传的那样工作。
关于sbt - 如何使用publishLocal覆盖本地稳定版本工件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26077419/
我有兴趣弄清楚 sbt.TaskKey 或 sbt.SettingKey 的一些操作是做什么的 n + "-assembly-" + v + ".jar" } 此时你必须以某种方式知道 jarN
是否可以在 SBT 中注释掉整个文本 block ,类似于 /* Java 样式 block 注释 */ 语法?我遇到了一些构建错误,只能使用多个单行注释。 我看到的构建错误是解析表达式时出错。确保设
我在 Windows 上运行 SBT 1.1.1。 如果我将以下行放在 build.sbt 中,我的构建就可以了: credentials += Credentials(Path.userHome /
Maven 有 optional dependency概念。在 SBT 文档中搜索可选依赖项仅找到 "However, sometimes we have optional dependencies
我有一个 sbt 项目,其中包含大量子项目和外部库依赖项。 build.sbt是这样的: val extlib1 = "xy.xxx" % "lib1" % "1.0+" val extlib2 =
在编译我的 SBT 项目定义(即 project 目录中的文件)时,我收到了弃用和功能警告。 SBT 版本是 0.13.0。 我没有通过设置 scalacOptions := Seq("-featur
根据经验, build.sbt 中声明的库依赖项的顺序似乎很重要。这是真的?如果是这样,值得在 sbt library management 中简要提及。文档的部分。 最佳答案 是的,列出的顺序是用于
我希望我遗漏了一些东西,因为当程序在 sbt 中运行时,按键似乎不会回显到屏幕上。 下面是一个例子: object ConsoleTest extends App { println("Enter
[SBT 文档] 说 Put settings in a .sbt file in a project that isn't checked into version control, such as
这个问题在这里已经有了答案: How to use sbt from behind proxy? (16 个回答) 7年前关闭。 我试图在防火墙后面运行 sbt,但我无法禁用它。但不知何故,我可以获得
我刚刚偶然发现了 sbt-pack插入。开发流好像steady .这让我感到惊讶,因为我认为(引用 sbt-pack 的标题)唯一的插件是“创建可分发的 Scala 包”。是 sbt-assembly
如何配置 sbt 以使用代理? 例如,我的构建定义需要连接到 GitHub,指定 http.proxy、http.proxyPort、user 的连接参数,和密码。 我如何将这些设置传递给 sbt?
我似乎无法找到下面看到的第一次驱逐的根本原因。如下所示,运行 evicted 不会提供与其相关的详细信息。 这一切都是在添加到 project/plugins.sbt 之后发生的:libraryDep
我正在用 sbt 0.11.2 创建一个 Scala 项目和 sbt-idea,我得到了 UNRESOLVED DEPENDENCIES在 gen-idea任务。 我刚刚安装了 sbt(下载了 jar
对于使用 sbt 0.13.5 成功构建的项目(尝试升级到 0.13.6,仍然无法正常工作),我们在构建服务器上突然出现故障(typesafe 和 maven 存储库通过我们的内部 Nexus 存储库
在 unix shell 中试试这个: git clone git@github.com:jsuereth/sbt-in-action-examples.git cd sbt-in-action-ex
我想知道什么时候应该使用sbt assembly,什么时候应该使用sbt compile && sbt package? 我正在使用 Intellij IDEA 在我的本地计算机上编写一个程序,并使用
有没有人使用 sbt-aether-deploy 将 sbt-native-packager 生成的工件(在我的例子中是 tgz)发布到 nexus 仓库? (我需要这个用于带时间戳的快照,特别是 n
我正在尝试在使用 SBT 版本 0.13.5 的项目中启用自定义 AutoPlugin。当我尝试在我的 build.sbt 中启用插件时通过: val aProject = project.in(fi
我正在安装Apache Spark它使用自己的 SBT 副本来进行设置。 我在 VirtualBox 虚拟机中使用 Linux Mint。 以下是我从 Spark 目录 spark-0.9.0-inc
我是一名优秀的程序员,十分优秀!