使用Netbeans,Maven和Glassfish进行热部署更改 [英] Hot deploying changes with Netbeans, Maven, and Glassfish
问题描述
现在,当我在WAR中编辑和保存这些类型的文件时,没有任何反应。我必须右键单击我的EAR - >使用依赖项进行构建 - >运行以使更改可用。这个过程需要很长时间。
我发现了一些类似的问题,但我仍然感到困惑。
编辑:我刚刚擦拭了我的开发环境,并再次从头开始设置。然后我在同事的机器上复制安装(他在Windows上,我在Ubuntu上)。使用相同的设置过程,更少的操作系统,他可以编辑/保存xhtml文件,并且无需额外的步骤就可以看到更改! 解决方案
要启用热部署,请启用Netbeans中的保存时编译功能。在您的POM中,添加以下属性:
< netbeans.compile.on.save>所有< /netbeans.compile.on .save>
这个属性会被继承,所以如果你有一个父项目,你可以考虑把它放在那里。
请注意,这个更改没有反映在用户界面中,因此它看起来像属性没有任何作用,但您会注意到热点-deploy works。
Recently we migrated from using ant to maven. Within Netbeans, I used to edit and save html, xhtml, javascript, css files in the WAR and almost immediately the changes were available on the server.
Now, when I edit and save those types of files in the WAR, nothing happens. I have to right click my EAR -> Build with dependencies -> Run to make the changes available. This process takes ages.
I've found a few similar questions, but am still confused.
EDIT: I just wiped my development environment and setup from scratch again. Then I duplicated the setup on a co-worker's machine (him on Windows, me on Ubuntu). With the same setup process, less different OSs, he can edit/save xhtml files and see the changes without additional steps!
To enable hot-deploy, enable the "Compile on Save" feature in Netbeans. In your POM, add this property:
<netbeans.compile.on.save>all</netbeans.compile.on.save>
This property will be inherited, so if you have a parent project, you may consider putting it there.
Note that there is a bug in which the change is not reflected in the UI, so it will look like the property has no effect, but you'll notice that hot-deploy works.
这篇关于使用Netbeans,Maven和Glassfish进行热部署更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!