Sbt 替代“mvn install -DskipTests”

发布于 2025-01-08 16:33:48 字数 193 浏览 4 评论 0原文

我正在尝试将基于 sbt 的项目安装到本地 Maven 存储库。我尝试过命令:

  • “sbtpublish” - 需要存储库凭据
  • “sbtpublish-local”安装到.ivy存储库,但我需要maven!

我怎样才能用SBT进行这样的操作呢?

I'm trying to instal sbt based project to local maven repository. I have tried commands:

  • "sbt publish" - require repository credentials
  • "sbt publish-local" install to .ivy repositry, but I need maven!

How can I do such operation in terms of SBT?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

后来的我们 2025-01-15 16:33:48

SBT wiki 有这些东西。只需定义存储库(在链接页面上查找“发布到用户本地 maven 存储库”)并调用“发布”。

The SBT wiki has the goods. Just define the repo (look for "Publishing to the users local maven repository" on the linked page) and invoke "publish".

猥琐帝 2025-01-15 16:33:48

使用 SBT 0.13 且无需编辑项目源文件:

  • ~/.sbt/0.13 中创建(或编辑)global.sbt 文件:

    vim ~/.sbt/0.13/global.sbt

  • 添加以下行:

    publishTo := Some(Resolver.file("file", new File(Path.userHome.absolutePath+"/.m2/repository")))

  • 保存并关闭文件

  • 从项目文件夹运行sbtpublish

Using SBT 0.13 and without editing the project source files:

  • Create (or edit) a global.sbt file in ~/.sbt/0.13:

    vim ~/.sbt/0.13/global.sbt

  • Add the following line:

    publishTo := Some(Resolver.file("file", new File(Path.userHome.absolutePath+"/.m2/repository")))

  • Save and close the file

  • Run sbt publish from the project folder
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文