如何清理Heroku依赖关系缓存(非托管的Maven依赖关系) [英] How to clean Heroku dependency cache (unmanaged maven dependencies)

查看:118
本文介绍了如何清理Heroku依赖关系缓存(非托管的Maven依赖关系)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我必须在我的java / maven heroku应用程序中使用非托管SNAPSHOT依赖项。
我使用这篇文章中描述的项目本地maven资料库来执行此操作。



Heroku缓存构建之间的依赖关系。不幸的是,Heroku没有注意到SNAPSHOT版本是否改变并继续使用缓存的依赖关系。这会导致编译错误,因为我依赖SNAPSHOT版本中的更改。



是否有方法手动或自动清理此依赖关系缓存?



我发现这个 maven插件(它执行本地构建并将产生的文物推送到heroku),但它并不是我想要的方式。



有人可能会认为它首先使用这种快照依赖性是一种不好的做法,但我认为还有其他或多或少有效的清理现金的理由,例如因为非托管依赖关系如果从项目本地存储库中删除,它们甚至不会被删除。



感谢您的回答

解决方案

分支 java buildpack 清除maven缓存。要使用它,请将您的应用程序配置为使用 cache_clear 分支:

heroku config:设置BUILDPACK_URL = https://github.com/heroku/heroku-buildpack-java.git#cache_clear



== =更新===



插件

a>可清除任何应用程序的缓存。安装并运行清除缓存命令。



$ heroku插件:安装https://github.com/heroku/heroku-repo.git



$ heroku repo:purge_cache -a appname



I have to use an unmanaged SNAPSHOT dependency in my java/maven heroku app. I do this using a project-local maven repository as desribed in this article.

Heroku caches the dependencies between builds. Unfortunatly Heroku does not notice if the SNAPSHOT Version changes and keeps on using the cached dependency. This leads to compilation errors as I depend on changes in the SNAPSHOT version.

Is there a way to manually or automatically clean this dependency cache?

I found this maven plugin (it does a local build and pushes the resulting artefacts to heroku) but its not really the way I want to do it.

One could argue its a bad practice to use this snapshot dependency in the first place but I think there are other more or less valid reasons for cleaning the cash e.g. leaking storage as the unmanaged dependencies are not even removed if they are deleted from the project local repository.

I appreciate your answer

解决方案

There's a branch of the java buildpack that clears maven cache. To use it, configure your app to use the cache_clear branch:

heroku config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-java.git#cache_clear

===Update===

There's a plugin that clears cache on any app. Install it and run the purge-cache command.

$ heroku plugins:install https://github.com/heroku/heroku-repo.git

$ heroku repo:purge_cache -a appname

这篇关于如何清理Heroku依赖关系缓存(非托管的Maven依赖关系)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆