sbt 0.11.3: getting latest version of a git plugin

笑着哭i 提交于 2019-12-23 09:04:07

问题


I've a multi-project structure which builds with sbt 0.11.3. I wanted to centralize my dependency versions, project versions, artifacts, shell prompt stuff and such. It would be really helpful for my plans on release management and version control. So I've created a plugin and put my global configurations there. My projects read it from github and build it as a plugin. Everything is lovely.

./project/project/Build.scala

import sbt._

object PluginDef extends Build {
    override lazy val projects = Seq(root)
    lazy val root = Project("plugins", file(".")) dependsOn(versionPlugin)
    lazy val versionPlugin = uri("git://github.com/config.git") //changed the uri here
}

So sbt fetches the plugins latest version if it haven't been already. Caches that version in ~/.sbt/staging/somehashcode. But I couldn't make it update the project when there are changes in plugin project. I manually go and update it whenever needed. Sadly, in a 20 man team its causing some problems.

How can we make it check for plugin updates?


回答1:


I haven't tried this, but the following might work.

refreshing plugin

  1. update to sbt 0.12.1, which fixes update
  2. then from sbt shell:

    > reload plugins
    > update
    > reload return
    

specifying a particular tree

It may be helpful to fix the source dependency to a particular point in time for some situations. If so you can add commit hash or tag as "git://github.com/config.git#hash".



来源:https://stackoverflow.com/questions/13699096/sbt-0-11-3-getting-latest-version-of-a-git-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!