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] –