我在发布/使用bintray的自定义sbt插件时遇到了一些麻烦。我能够
在bintray上发布sbt-plugin
但是当我尝试使用它时解析器使用它
另一条路。
我已关注official guide但已将其调整为最新版本的插件,我已将此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")
)
sbt-plugin> publish
任务成功完成并将我的插件发布到
的 me.my.app/sbt-plugin/scala_2.10/sbt_0.13/0.1.0/jars/sbt-plugin.jar
然后我将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与
插件已发布的地方。 (我的插件publishLocal
是
以相同的路径发布但成功解决。
me.my.app/sbt-plugin/scala_2.10/sbt_0.13/0.1.0/jars/sbt-plugin.jar
me.my.app/sbt-plugin/scala_2.10/sbt_0.13/0.1.0/jars/sbt-plugin.jar
me/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
- >的 me.my.app/sbt-plugin/scala_2.10/sbt_0.13/0.1.0/jars/sbt-plugin.jar publishMavenStyle := true
- >的 me.my.app/sbt-plugin/scala_2.10/sbt_0.13/0.1.0/jars/sbt-plugin.jar
Resolver.bintrayRepo
- > 我/我的/应用/ SBT-plugin_2.10_0.13 / 0.1.0 / SBT-插件-0.1.0.pom
Resolver.bintrayIvyRepo
- >的 me.my.app/sbt-plugin/scala_2.10/sbt_0.13/0.1.0/ivys/ivy.xml 答案 0 :(得分:0)
出版部分还可以。唯一的问题是在解决方面。
我必须将带有显式 ivyStylePatterns 解析程序的自定义解析程序添加到 <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_marginTop="90dp"
tools:context=".DeviceFragment" >
<ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:divider="#b5b5b5"
android:dividerHeight="1dp"
android:listSelector="@drawable/list_selector" />
</LinearLayout>
中:
my-project\build.sbt