更新外部 Maven 依赖项而无需完全重新部署

发布于 2024-12-04 16:15:17 字数 300 浏览 1 评论 0原文

首先我要说的是,我对 Maven 只有基本的了解。我需要更好地理解它,这就是我的问题所在。

编辑 我有一个大型 tomcat web 应用程序,它有多个外部依赖项(JAR),我只需要更新其中一个并将其移至生产环境。

由于缺乏更好的措辞/术语,如何更新外部依赖项并仅部署那些而不重新部署整个项目?此外部依赖项位于远程存储库中,此后我更新了 pom 文件中的版本号,我只需要更新此依赖项,然后仅将其部署到我的生产系统。

另外,如果有人有任何初学者 Maven 教程/入门书,他们可能会建议这会很棒。

谢谢。

Let me preface this by saying that I only have a basic understanding of Maven. I need to get a better grasp of it and that's where my question comes in.

EDIT
I have a large tomcat webapp, that has multiple external dependencies(JARs) and I only need to update one of them and move it into production.

For lack of better wording/terms, how do I update my external dependencies and deploy only those without re-deploying my entire project? This external dependency is located in a remote repo, I have since updated the version number in my pom file and I need to update only this dependency and then deploy only it to my production systems.

Also if anyone has any beginner maven tutorials/primers they could suggest that would be great.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

多像笑话 2024-12-11 16:15:17

例如,如果您的意思是您有一个 WAR 项目,并且您需要将 WAR 中的某些库更新为新版本并部署它,那么在 Maven 世界中,您已经创建了项目的新版本,并且您会将其视为任何其他更改:发布它,测试它,并将新版本投入生产。当然,在实践中,您可以将新 JAR 放在应用程序服务器上并删除旧 JAR。不过,这是一个手动修复,并且根据进程的正常运行方式,它可能是危险且脆弱的。进行正常发布是“正确”的方式。

If you mean that you have a WAR project, for example, and you need to update some library in the WAR to a new version and deploy it, then in the Maven world, you've created a new version of your project, and you would treat it as any other change: release it, test it, and push the new version into production. In practice, of course, you could just put the new JAR out on your app server and remove the old one. That's a manual fix, though, and depending on how your process normally runs, it could be dangerous and fragile. Doing a normal release is the "right" way.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文