1
我創建了一個問題重複的例子的SBT插件我與SBT插件分辨率經歷:無法解析發佈到一個Maven回購
https://github.com/NicolasRouquette/sbt.problem.example
這個例子有兩個SBT項目:
test.plugin
簡單SBT插件test.app
使用了test.plugin
一個簡單的SBT項目0
也有到該test.plugin
與包括像這樣的特性POM文件發佈的本地倉庫:
<properties>
<git.branch>master</git.branch>
<git.commit>fe2dc11d6fbb85c5ce0e83b031bbd425997bbd59</git.commit>
<git.tags></git.tags>
</properties>
<properties>
<scalaVersion>2.10</scalaVersion>
<sbtVersion>0.13</sbtVersion>
<extraDependencyAttributes xml:space="preserve">+e:sbtVersion:#@#:+0.13:#@#:+module:#@#:+sbt-license plugin:#@#:+e:scalaVersion:#@#:+2.10:#@#:+organisation:#@#:+com.banno:#@#:+branch:#@#:[email protected]#:NULL:#@:#@#:+revision:#@#:+0.1.5:#@#:
+e:sbtVersion:#@#:+0.13:#@#:+module:#@#:+sbt-license-report:#@#:+e:scalaVersion:#@#:+2.10:#@#:+organisation:#@#:+com.typesafe.sbt:#@#:+branch:#@#:[email protected]#:NULL:#@:#@#:+revision:#@#:+1.0.0:#@#:
+e:sbtVersion:#@#:+0.13:#@#:+module:#@#:+sbt-git:#@#:+e:scalaVersion:#@#:+2.10:#@#:+organisation:#@#:+com.typesafe.sbt:#@#:+branch:#@#:[email protected]#:NULL:#@:#@#:+revision:#@#:+0.8.5:#@#:
+e:sbtVersion:#@#:+0.13:#@#:+module:#@#:+aether-deploy:#@#:+e:scalaVersion:#@#:+2.10:#@#:+organisation:#@#:+no.arktekk.sbt:#@#:+branch:#@#:[email protected]#:NULL:#@:#@#:+revision:#@#:+0.16:#@#:
</extraDependencyAttributes>
</properties>
我不能test.app
運行SBT因爲SBT未能解決test.plugin
:
addSbtPlugin("org.test" % "test-plugin" % "1.0")
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.test#test-plugin;1.0: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] org.test:test-plugin:1.0 (sbtVersion=0.13, scalaVersion=2.10)
[warn]
[warn] Note: Unresolved dependencies path:
[warn] org.test:test-plugin:1.0 (sbtVersion=0.13, scalaVersion=2.10) (/opt/local/imce/users/nfr/github.imce/example/test.app/project/plugins.sbt#L6-7)
[warn] +- default:test-app-build:0.1-SNAPSHOT (sbtVersion=0.13, scalaVersion=2.10)
sbt.ResolveException: unresolved dependency: org.test#test-plugin;1.0: not found
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:294)
at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:191)
at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:168)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:155)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:155)
at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:132)
at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:57)
...
基於試圖瞭解發生了什麼事情與調試,我得到的印象是:
- 運行SBT時解析插件很早就發生了;這意味着它涉及很多SBT/Ivy機器
- 我不太明白SBT/Ivy機器如何解決發佈到Maven存儲庫的SBT插件(儘管我在某處看到某種Maven/Ivy轉換)
- 似乎Maven的POM性質,不分析檢索sbtVersion(如0.13)和scalaBinaryVersion(如2.10)的工件
的有人能確認/糾正我的分析?
有沒有辦法讓這個Maven發佈的插件依賴查找工作?
謝謝@EugeneYokota,這解決了我的問題! –
至於合併POM中的屬性,我使用pomPostProcess改進了解決方案,請參見[https://github.com/NicolasRouquette/sbt.problem.example/blob/master/test.plugin/build.sbt#L51] –