Tôi đang cố gắng xuất bản một plugin SBT vào một kho lưu trữ. Tôi không chắc chắn nếu điều này có bất kỳ sự liên quan, nhưng chúng tôi Plugin tải plugin sbt-twirl
- Googling xung quanh, nó có vẻ như publishConfiguration có thể được overriden:Tại sao dự án plugin xuất bản không thành công với RuntimeException: Kho lưu trữ để xuất bản không được chỉ định?
new PublishConfiguration(None, "dotM2", arts, Seq(), level)
Khi tôi chạy công bố nhiệm vụ, đồ tạo tác được triển khai tới các repo , nhưng nhiệm vụ sbt sau đó không thành công:
sbt (my-sbt-plugin)> publish
[info] Loading global plugins from ...
...
[info] Done packaging.
[info] published sbt-my-sbt-plugin to http://my.repo.com/.../sbt-my-sbt-plugin-0.1-SNAPSHOT.jar
java.lang.RuntimeException: Repository for publishing is not specified.
.... stack trace here ....
[error] (my-sbt-plugin/*:publishConfiguration) Repository for publishing is not specified.
Điều gì gây ra lỗi và tôi có thể làm gì để ngăn việc xuất bản không thành công?
** Update ** Đây là inspect publish
sbt (my-sbt-plugin)> inspect publish
[info] Task: Unit
[info] Description:
[info] Publishes artifacts to a repository.
[info] Provided by:
[info] {file:/path/to/my-sbt-plugin/}my-sbt-plugin/*:publish
[info] Defined at:
[info] (sbt.Classpaths) Defaults.scala:988
[info] Dependencies:
[info] my-sbt-plugin/*:ivyModule
[info] my-sbt-plugin/*:publishConfiguration
[info] my-sbt-plugin/*:publish::streams
[info] Delegates:
[info] my-sbt-plugin/*:publish
[info] {.}/*:publish
[info] */*:publish
[info] Related:
[info] plugin/*:publish
Đây là cách tôi đã cấu hình xuất bản (với một số cài đặt plugin, trừ libraryDependencies và 1 hoặc 2 thiết lập khác)
lazy val plugin = project
.settings(publishSbtPlugin: _*)
.settings(
name := "my-sbt-plugin",
sbtPlugin := true,
addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.0.2")
)
def publishSbtPlugin = Seq(
publishMavenStyle := true,
publishTo := {
val myrepo = "http://myrepo.tld/"
if (isSnapshot.value) Some("The Realm" at myrepo + "snapshots")
else Some("The Realm" at myrepo + "releases")
},
credentials += Credentials(Path.userHome/".ivy2"/".credentials")
)