有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java将Spring引导jar部署到Azure,并使Azure重新启动

我在Jenkins上构建了一个Spring引导jar,并通过FTP上传到Azure,但由于应用程序仍在运行,我在下面得到了错误信息。在azure上处理此问题的推荐方法是什么?我想我应该在上传jar之前关闭服务器,然后在上传之后再次启动它

..........
FTP: Connecting from host [ip-172-20-20-20]
FTP: Connecting with configuration [Back-End-Azure-FTP] ...
FTP: Disconnecting configuration [Back-End-Azure-FTP] ...
ERROR: Exception when publishing, exception message [Could not write file. Server message: [550 The process cannot access the file because it is being used by another process. 
]]
Build step 'Send build artifacts over FTP' changed build result to UNSTABLE
Notifying upstream projects of job completion
Finished: UNSTABLE

提前谢谢


共 (1) 个答案

  1. # 1 楼答案

    实现这一点的一种方法是使用弹簧执行器。它们被记录在案here。他们有很多方便的工具API,关闭是其中一种方法。您可以插入一个简单的POM依赖项,这应该可以做到(还可以在应用程序yaml中启用关机)

    在运行FTP部件之前,必须通过cURL执行post调用以停止它,然后部署新版本包