This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 243484

Summary: Auto-deploy HTML files in multi-module-maven-project doesn't work
Product: javaee Reporter: CptS
Component: MavenAssignee: Martin Janicek <mjanicek>
Status: NEW ---    
Severity: normal CC: DavidLeoni, heatseeker, jumperchen
Priority: P2    
Version: 8.0   
Hardware: PC   
OS: Windows 7   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: a small and simple example project
a EAR example project

Description CptS 2014-04-02 15:47:45 UTC
Created attachment 146504 [details]
a small and simple example project

Overview:
I have a multi-module maven project. There are two modules, one is a war and the other is a jar.
In the war I have a web application using Apache Wicket. In the jar I have a Wicket Panel. This panel will be used by the web application - the war has a dependency on the jar.
The compile and deploy on save options are enabled and only work if I change the java or html files in the war project.
Changes in the java classes in the jar-module also work fine, but if I change the html file in the jar module the changes are not auto-deployed.

Steps to reproduce:
1. Create a maven POM project
2. Create the two modules, e.g. "web" (packaging "war" - archetype wicket-quickstart-archetype) and "testmodule" (packaging "jar")
3. Create a wicket panel (java class + html file) in the "testmodule" project
4. Use this panel in the HomePage.java and HomePage.html
5. Run the web project in debug mode
6. Change the content of the files and reload in the browser after each change

Actual Results:
Changes in HomePage.java will be auto-deployed on save and I can see the changes in the browser.
Changes in HomePage.html will be auto-deployed on save and I can see the changes in the browser.
Changes in TestPanel.java will be auto-deployed on save and I can see the changes in the browser.
Changes in TestPanel.html won't be auto-deployed on save and I can't see the changes in the browser.

Expected Results:
All changes in java classes and html files should be auto-deployed on save.

Tested in NetBeans IDE 8.0 (Build 201403101706) with Tomcat 8.0.3.0

I have created and attached a small and simple example project.
See also http://forums.netbeans.org/viewtopic.php?t=59914
Comment 1 Martin Janicek 2014-07-17 12:13:12 UTC
I will take a look at it..
Comment 2 Martin Janicek 2014-07-17 12:55:56 UTC
Well this is basically impossible to support. Your project structure is:

- WAR module containing dependency on JAR module
- Only WAR module is needed for deployment and it includes JAR module as a library dependency

For a correct auto-deployment we would need to rebuild your JAR module everytime when you would make any kind of change. That would obviously make the IDE uncomfortable to use.

The way how auto-deployment usually works is that we take the updated files and copy them (+ compile them in case of .java/groovy files) to the exploded directory used by the server for deployment. That allow us to avoid compiling the whole module.

EAR project used to wrap up your module would help, but I guess that wont work for you if you need to use lightweight Tomcat for the deployment.

Don't see any simple solution at the moment, but I will try to think about it a little more.
Comment 3 CptS 2014-07-17 13:56:30 UTC
I have tried a EAR in wildfly 8. But again, it unfortunately does not work.
I do not see any change after reload of the browser when I change one of the 4 files (HomePage.java, homepage.html, TestPanel.java, TestPanel.html).
I think Netbeans doesn't compile anything on save in one of the modules.

[Tools] [Options] [Java] [Java Debugger] "Apply code changes after save ..."  is enabled.
In all Modules [Properties] [Build] [Compile] "Compile On Save" is enabled.

Have I missed something?

I've attached the modified sample project.
Tested in NetBeans IDE 8.0 (Build 201403101706) with Wildfly 8.0.0 and GlassFish Server Open Source Edition 4.0 (build 89).
Comment 4 CptS 2014-07-17 14:00:28 UTC
Created attachment 148105 [details]
a EAR example project
Comment 5 Martin Janicek 2014-07-28 11:50:01 UTC
Sorry, there won't be enough of time to fix this issue into 8.0.1 patch.
Comment 6 Martin Janicek 2014-07-30 08:39:43 UTC
Changing to enhancement and increasing priority - we will need a special support to allow this.
Comment 7 Martin Janicek 2014-07-30 12:39:08 UTC
*** Bug 223217 has been marked as a duplicate of this bug. ***
Comment 8 Martin Janicek 2014-07-30 12:45:05 UTC
*** Bug 206030 has been marked as a duplicate of this bug. ***