Wildfly Maven插件+热部署 [英] Wildfly Maven plugin + hot deployment

查看:306
本文介绍了Wildfly Maven插件+热部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在Eclipse Mars中配置的Java Spring应用程序,并且正在Eclipse中从中运行Wildfly 9.我正在使用wildfly-maven-plugin部署到服务器.

I have a Java Spring application, configured in Eclipse Mars and I am running Wildfly 9 from with in Eclipse. I am using the wildfly-maven-plugin to deploy to server.

这些是我要执行的步骤:

These are the steps I follow:

从eclipse启动服务器并进行Maven构建,该构建还将应用程序部署到服务器.我可以在成功部署"的服务器上看到很多日志,并且可以在浏览器中访问我的应用程序.它在"/standalone/data/content"下创建一个文件夹,但在"standalone/deployments"下没有战争或爆炸性的战争.

Start the server from eclipse and do Maven build which also deploys the application to server. I can see whole lot of logs on server of "successful deployment"and I can access my application in browser. It creates a folder under "/standalone/data/content" but no war or exploded WAR under "standalone/deployments"

如果我更改了一些代码并将其保存在eclipse中,(我已选中自动发布"复选框并在保存的基础上进行构建),则服务器日志将显示:用部署"myApp.war"替换了部署"myApp.war",内容已从中删除位置独立\数据\内容..."

If I change some code and save it in eclipse, (I have checked Automatically publish check box and build on save), The sever logs says: Replaced deployment "myApp.war" with deployment "myApp.war" Content removed from location "standalone\data\content..."

我看到在步骤1中创建的prev文件夹已删除,并且myApp.war已添加到部署文件夹.但是现在我无法在浏览器中访问我的应用程序.

And I see the prev folder created during step 1 is removed and myApp.war is added to deployment folder. But now I can not access my application in browser.

auto-deploy-exploded="true"

那是在standalone.xml的部分.

That is in the section of standalone.xml.

推荐答案

wildfly-maven-plugin使用管理操作部署应用程序.它不会仅部署存档中的任何爆炸内容.换句话说,在重新部署之前,您需要重新创建部署存档,否则将看不到更改.

The wildfly-maven-plugin deploys applications using management operations. It doesn't deploy any exploded content only the archive. In other words you'd need to recreate the deployment archive before you redeploy otherwise changes won't be seen.

@ozOli 表示,最好使用JBoss工具.

As @ozOli says it's probably best to use JBoss Tools.

有一个公开的问题允许部署爆炸性内容.目前仅针对run目标建议使用此方法,但也有可能将其扩展为部署爆炸内容.我认为部署爆炸性内容作品.

There is an open issue to allow exploded content to be deployed. This is currently suggested only for the run goal, but it could likely be expanded to deploy exploded content as well. I think deploying exploded content works.

通常,尽管热部署"的问题是源需要重新编译,然后重新部署.重新部署是注释的关键,需要重新扫描.

In general though the issue with "hot deployments" is source needs to be recompiled and then redeployed. The redploy is key as annotations and such need to be rescanned.

这篇关于Wildfly Maven插件+热部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆