我有一些麻烦,以出版/使用自定义的sbt插件从绑定。我可以在绑定盘上发布sbt-plugin,但是当我尝试使用它时,解析器使用另一条路径。
我遵循了官方指南,但将其改编为插件的最新版本,我在插件中使用了这个build.sbt:
lazy val commons = Seq(
organization in ThisBuild := "me.my.app",
version in ThisBuild := "0.1.0"
)
lazy val root = (project in file(".")).
settings(commons ++ BintrayPlugin.bintrayPublishSettings: _*).
settings(
sbtPlugin := true,
name := "sbt-plugin",
description := "Share configuration and plugins accros app projects",
bintrayOmitLicense := true,
publishMavenStyle := false,
bintrayRepository := "sbt-plugins",
bintrayOrganization := None
).
settings(
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0"),
addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.6.0"),
addSbtPlugin("org.scalastyle" % "scalastyle-sbt-plugin" % "0.8.0")
)成功完成me.my.app/sbt-plugin/scala_2.10/sbt_0.13/0.1.0/jars/sbt-plugin.jar任务并将插件发布到sbt-plugin> publish中
然后我将addSbtPlugin("me.my.app" % "sbt-plugin" % "0.1.0")添加到my-project\project\plugins.sbt并重新加载它。但他失败了
[warn] ==== bintray-{organization}-{repo}: tried
[warn] https://dl.bintray.com/{organization}/sbt-plugins/me/my/app/sbt-plugin_2.10_0.13/0.1.0/sbt-plugin-0.1.0.pom
...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: me.my.app#sbt-plugin;0.1.0: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] me.my.app:sbt-plugin:0.1.0 (scalaVersion=2.10, sbtVersion=0.13)
[warn]
[warn] Note: Unresolved dependencies path:
[warn] me.my.app:sbt-plugin:0.1.0 (scalaVersion=2.10, sbtVersion=0.13) (/home/me/Projects/app/app-web/project/plugins.sbt#L7-8)
[warn] +- default:app-web-build:0.1-SNAPSHOT (scalaVersion=2.10, sbtVersion=0.13)
sbt.ResolveException: unresolved dependency: me.my.app#sbt-plugin;0.1.0: not found
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:313)
[error] (*:update) sbt.ResolveException: unresolved dependency: me.my.app#sbt-plugin;0.1.0: not found如您所见,用于下载插件的URL与发布插件的URL不一样。(使用publishLocal,我的插件在相同的路径下发布,但成功地解决了问题。
me.my.app/sbt-plugin/scala_2.10/sbt_0.13/0.1.0/jars/sbt-plugin.jarme.my.app/sbt-plugin/scala_2.10/sbt_0.13/0.1.0/jars/sbt-plugin.jarme/my/app/sbt-plugin_2.10_0.13/0.1.0/sbt-plugin-0.1.0.pom不管有没有publishMavenStyle := false,我都尝试过Resolver.bintrayRepo和Resolver.bintrayIvyRepo,但都没有成功。
我会错过一些东西,但我必须承认,我感到有点迷茫。那么,应该对齐上传和下载路径的缺失配置是什么呢?
详细信息:
publishMavenStyle := false ->publishMavenStyle := true ->Resolver.bintrayRepo ->Resolver.bintrayIvyRepo ->发布于 2016-10-20 12:25:27
出版部分没问题。唯一的问题是在决议方面。
我必须将带有显式ivyStylePatterns解析器的自定义解析器添加到my-project\build.sbt中:
resolvers += Resolver.url("me @ bintray", url("https://dl.bintray.com/{my-bintray-account}/{my-bintray-generic-repo}"))(Resolver.ivyStylePatterns)https://stackoverflow.com/questions/40146524
复制相似问题