简体   繁体   中英

SBT Resolver for plugin in local directory on Heroku

I have an internal SBT plugin which sets up a lot of common aspects of my build. One of those is my setup to add my Artifactory credentials and resolvers. I typically publish the plugin locally so that my build can resolve it and then pull the remaining dependencies from my Artifactory repositories.

For deploying to Heroku, I planned to copy the published artifacts from my .ivy2 repo to a subfolder of the project. However, though I can get this to work locally using both Resolver.file and Resolver.url, I cannot get this to work once I push to Heroku. I even tried it as an unmanaged dependency but still unresolved in Heroku.

Does anyone know the magic spell for achieving this on Heroku?

I have attempted following in project/plugins.sbt:

Resolver.url.("local-plugins", url(s"file///${baseDirectory.value}/plugins"))(Resolver.ivyStylePatterns)

Resolver.file("local-plugins", file("plugins")(Resolver.ivyStylePatterns)

unmanagedBase := baseDirectory.value / "lib"

I recommend two different approaches:

  • Use the sbt-heroku plugin instead of deploying with Git. You can use local dependencies this way.
  • Deploy your plugin to BinTray . It's fairly easy, free, and worth the trouble.

I revisited this again today and the following worked:

In plugins.sbt:

resolvers += Resolver.file("local-plugins", file("local-plugins"))(Resolver.ivyStylePatterns)

My project also contains a local-plugins/ directory in the working folder which holds the published artifacts.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM