简体   繁体   中英

How to automatically upgrade a Java application during its startup?

I have a Java 1.6 application deployed on several machines (~ 30), and started as a Windows service.

My main problem concerns the maintenance of these deployed artifacts: if I develop a new version of this application, I don't want to manually redeploy it on every machine.

Ideally, when the Windows service is starting, it checks on a remote server if an update exists, and if it is found, then it upgrades the application. Note that it is acceptable that after this upgrade the service requires to be restarted again.

This mechanism can be compared to the Maven snapshot verification: if there is a newer version of a SNAPSHOT version on a remote repository, then Maven download it before running it. Note that the application itself will be deployed on a Maven repository (in our case Nexus), so the check for an update will be done against this Nexus instance.

What are my technical solutions to implement such an automatically application update?

Do not hesitate to ask me more details about technical information or about the context...

Thanks.


Edit : As stated by Peter Lawrey, I can use Java Web Start. However, how can I integrate JWS within a Java application that is run as a Windows service?

我会看一下Java Web Start

A common technique for this is to use a launcher. The steps are something like this:

  1. Start the launcher.
  2. The launcher checks to see if the application should be updated. If yes, the launcher updates the application (I think of this as "the update step").
  3. After the update step, the launcher runs the application.

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