Wildfly Maven plugin + hot deployment

China☆狼群 提交于 2020-01-17 03:51:04

问题


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:

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"

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..."

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"

That is in the section of standalone.xml.


回答1:


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.

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

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.




回答2:


For Eclipse you can use the JBoss Tools plugins: http://tools.jboss.org/



来源:https://stackoverflow.com/questions/31943842/wildfly-maven-plugin-hot-deployment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!