简体   繁体   English

如何在客户端升级/更新web java项目?

[英]How do you upgrade / update web java project at your clients?

Let say we are developing a new client/server Java web application. 假设我们正在开发一个新的客户端/服务器Java Web应用程序。 We finally released 1.0 version and sold to few clients. 我们最终发布了1.0版本并卖给了少数客户。 Clients deployed our project on their own at their servers. 客户在自己的服务器上部署了我们的项目。 After some time we found a few bugs and we would like to update our application. 一段时间后,我们发现了一些错误,我们想更新我们的应用程序。

Is there any framework / technology / pattern / library / server that can help in developing app that can update itself automatically including such steps: 是否有任何框架/技术/模式/库/服务器可以帮助开发可以自动更新的应用程序,包括以下步骤:

  • copying new project release 复制新项目发布
  • undeploying old release 取消使用旧版本
  • deploying new release 部署新版本
  • updating db 更新数据库

At the moment we have vpn to our clients and we are doing all above steps manually. 目前我们已经向客户提供vpn,我们正在手动完成上述所有步骤。 Is it possible to synchronize our clients version with our repositiory? 是否可以将我们的客户版本与我们的存储库同步?

The technology you are talking about is an installer. 您正在谈论的技术是安装程序。 And application installer frameworks exist. 并且存在应用程序安装程序框架

However, when you application stores important state in a database or whatever, automating the migration of the data is tricky and risky ... and next to impossible to do in the context of a generic installer product. 但是,当您的应用程序将重要状态存储在数据库中或其他任何情况时,自动迁移数据是棘手且有风险的......并且在通用安装程序产品的上下文中几乎不可能执行。 The same is true if your application can be customized by your customers. 如果您的应用程序可以由您的客户自定义,情况也是如此。 (There is always a chance that the customization will break your automated migration code.) (自定义化总是有可能破坏您的自动迁移代码。)

Now, if the steps that you currently perform manually are straightforward, and don't need to be adapted for different customer sites, then automation may be possible. 现在,如果您当前手动执行的步骤很简单,并且不需要针对不同的客户站点进行调整,则可以实现自动化。 But you need to make sure that you have a bomb-proof mechanism for backing up the customer's current installation and data and (if necessary) restoring it when your automated upgrade procedure fails. 但是,您需要确保有一个防弹机制来备份客户当前的安装和数据,并在必要时自动升级过程失败时进行恢复。

For the DB part, you can use liquibase . 对于DB部分,您可以使用liquibase Liquibase is a maven plugin/lib to manage database migrations (upgrading your database to more recent versions). Liquibase是一个管理数据库迁移的maven插件/ lib(将数据库升级到更新的版本)。 One way to do this with liquibase is to deploy a special servlet that will inquire a schema-table that contains the current db version. 使用liquibase执行此操作的一种方法是部署一个特殊的servlet,该servlet将查询包含当前db版本的模式表

If you can perform a remote deploy (eg: via tomcat admin interface or any other), you can always set up a custom script that performs the deploy for you. 如果您可以执行远程部署 (例如:通过tomcat管理界面或任何其他界面),您始终可以设置一个自定义脚本来执行部署。 You can then offer this script to the client so they can apply the updates following their own schedule. 然后,您可以将此脚本提供给客户端,以便他们可以按照自己的计划应用更新。

I don't recommend immediately rolling out updates to clients whenever they are available simply because they (and you) may not want to update them immediately. 我建议不要在客户可用时立即推出更新,因为他们(和您)可能不想立即更新它们。

JavaWebstart可以帮助部署客户端,但如果数据库也需要升级,我认为除非所有客户端都关闭,否则它不能安全地完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 您如何决定何时升级项目中的库? - How do you decide when to upgrade a library in your project? 如何在Eclipse中的Android项目中使用Java项目? - How do you use a Java project in your Android project in Eclipse? 您如何为您的 Java Web 应用程序自动化 Javascript 缩小? - How do you automate Javascript minification for your Java web applications? 如果升级应用程序服务器或JVM,是否会重新编译Java代码? - Do you recompile your java code if you upgrade your application servers or JVMs? 如何更新 Eclipse Web 服务客户端项目中的 wsdl? - How do you update the wsdl in a Eclipse Web Service Client project? 如何将PowerMock添加到项目中? - How do you add PowerMock to your project? 如何将现有NetBeans Java EE 6 Web项目升级到Java EE 7? - How do I upgrade an existing NetBeans Java EE 6 Web project to Java EE 7? 您如何/在何处搜索计算机/项目中已安装的Java库? - How / where do you search for installed java libraries on your computer / project? 为两个客户开发Java Web应用程序项目 - Java Web Application Project development for two clients 如何升级/更新现有Selenium Java项目的Selenium版本? - How to upgrade/update Selenium version of an existing Selenium Java project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM