GlassFish (real) hot deployment of JSF pages and resources (CSS etc.) in Eclipse

≡放荡痞女 提交于 2019-12-04 19:08:32

There is 'hack' that I use and works fine with maven, eclipse & GF4 hot deployment. Navigate inside your workspace where you have you xhtml project. open .project file edit

<buildCommand>
   <name>org.eclipse.m2e.core.maven2Builder</name>
   <arguments></arguments>
</buildCommand>

Modify to:

<buildCommand>
   <name>org.eclipse.m2e.core.maven2Builder</name>
   <triggers>incremental,</triggers>
   <arguments></arguments>
</buildCommand>

It works just fine for, but it might cause weird build issues (haven't tried for a long time so can't really say so use with case.)

============== Another workaround that I tried but run into eclipse/maven bugs==========

I managed to get this to work with eclipse. The steps were the following:

  1. Double-click on glassfish->expand Publishing and make sure that you set Automatically publish when resources changes
  2. Right-click on the server ->Glassfish and make sure User Jar Archives fro Deployement is unchecked
  3. Then make sure you have Project-Build automatically deselected

From what I can tell maven is touching resources on save, so Glassfish restarts. Hope it helps

If you have installed "Maven Integration for WTP" in your Eclipse, uninstall it (use m2e instead). Doing this, the hot-deployment of WebContent resources such as .xhtml and .css -files was reenabled to me. Unfortunately I don't know the reason for this workaround working.

Anyhow, I am also interested in your question of real hot-deployment (particularly of .java-files).

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