[英]Running a multi project Maven-built webapp on Heroku?
I'm migrating my multi project Java webapp from Cloudbees
to Heroku
. 我正在将我的多项目Java webapp从Cloudbees
到Heroku
。 I have one main webapp that depends on 3 other library projects that I have written (also Maven+Java ). 我有一个主要的Web应用程序,该应用程序依赖于我编写的其他3个库项目(还有Maven + Java )。 On Cloudbees
this was simple, you just build everything through Jenkins , the JARs get poked into their Maven repos then the main webapp gets built taking its dependencies from that Maven
repos. 在Cloudbees
这很简单,您只需通过Jenkins构建所有内容,然后将JAR插入其Maven仓库中,然后从该Maven
仓库中获取其依赖项来构建主Web应用程序。
However, I can't for the life of me find a way of doing this on Heroku without doing something horrendous like this: 但是,我无法终生找到一种在Heroku上做到这一点的方法,而不必做这样可怕的事情:
https://devcenter.heroku.com/articles/local-maven-dependencies https://devcenter.heroku.com/articles/local-maven-dependencies
By doing so it would mean that every time I changed a library I would have to remember to deploy the built JAR to the main webapp project and push this to Git, somewhat defeating the point of using Maven! 这样做意味着每次更改库时,我都必须记住将构建的JAR部署到主要的webapp项目并将其推送到Git,这在一定程度上打破了使用Maven的观点!
I understand that the way to deploy your webapp on Heroku is essentially by doing a git push to their repo, but how can I tell heroku at the other end to find my library dependencies without having to bundle them in the main webapp like this article suggests? 我了解在Heroku上部署WebApp的方法实质上是通过对其仓库进行git push,但是我如何才能告诉另一端的Heroku查找我的库依赖项,而不必像本文所述将它们捆绑在主webapp中?
I would assume that there is some way to set up a private maven repos on your heroku account but I can't find anything like this. 我认为可以通过某种方式在您的heroku帐户上设置私有Maven仓库,但是我找不到这样的东西。
I think the best solution is to use a private Maven repository, and then add the config for that repo in the settings.xml
of your main project. 我认为最好的解决方案是使用私有Maven存储库,然后在主项目的settings.xml
中添加该存储库的配置。 This article on using a custom settings.xml
describes how to do that. 有关使用自定义settings.xml
介绍了如何执行此操作。
There are some services that host private Maven repos for you, such as JFrog . 有一些服务可以为您托管私有Maven仓库,例如JFrog 。 But I've even read of people using Github to host a Maven repo , too. 但是我什至听说有人使用Github托管Maven存储库 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.