Why are xhtml files not refreshed using an .ear?
I have two projects, both using WildFly 14.0.1.Final as deployment server build using maven. One is a very simple test project that produces .war file. If I deploy the exploded file hot-swap works if I change the .xhtml file or a .java file. Changed .java file needs to be rebuild, while .xhtml files doesn't need anything, just a refresh of a browser.
However I can't seem to get the above description to work with a more complex project with an .ear file. Surprisingly the .java changes after rebuild on already running server take effect but I can't figure out how to make the .xhtml changes appear on a browser without re-deploying everything, which obviously takes way to long for a normal developing (20-30 seconds).
Things I've tried:
- Deployed .ear:exploded
- Tried all On 'Update' and On frame deactivation combinations
- Enable in 'Registry' compiler.automake.allow.when.app.running
- Enabled auto-deploy-exploded=true in standalone.xml (i think this file is overwritten by the idea tho)
Update: Looking at the .war containing the .xhtml file, the change isn't recorded. Looks like .war file isn't recreated?
Any help would be greatly appreciated. Thank you!
Please sign in to leave a comment.
I was trying to perform an use-case for you to reproduce it and during doing it, I've found a more simple case to test. These are the steps:
So now I get what the big issue is: This is not that properties are not replaced but the entire file is not generated. I thought properties weren't replaced but this is because the file was not generated and henceforth, not replaced.
I hope you can reproduce the case with this info and be treated as an issue. Thanks a lot in advance.
Hi. Please provide:
- full idea.log after reproducing an error,
- a complete textual result from Run/Debug tool window after an attempt to deploy in IDEA
- screenshots of Server, Deployment tabs of Run/Debug Configuration
Hi, I've managed to solve it by checking the "Unpack nested archives" in the Project Structure:
This works properly just if you don't execute previously a maven clean install, having into account that maven generates war as file but IntelliJ does it as directory, so they enter in conflicts one each other.
I would like to get a better solution for this bug rather than the "Unpack" option. Thanks in advance.
The unpack option is the proper solution. IDE can not guarantee a proper packaging if you mix Maven and IDE build for the artifacts packaging sorry, since it cannot control the Maven package.
The point is that if I dont build with maven, all properties which has to be replace under src/filters, are not.
Example:
I have a file persistence-tests.xml with a entry such as:
This property is set in pom.xml under a <profile> and in the file above, is replaced when I perform a mvn install through IntelliJ menu Maven / Run Maven / mvn install.
If I try no to use this maven buildind and I use "Generate sources and Update folders" instead from IntelliJ Maven menu, target dir is fully generated but the property is not set in my persistence-tests.xml file.
So, I really would like not to require to build using maven but IntelliJ building that not provided a "exactly-the-same-result" alternative which allow me to do so.
Is there a way I dont know to use just IntelliJ building without requiring use maven building but replacing maven properties in src/filters files?
Thanks in advance.
>If I try no to use this maven buildind and I use "Generate sources and Update folders" instead from IntelliJ Maven menu, target dir is fully generated but the property is not set in my persistence-tests.xml file.
This could be a bug. The property placeholders must be substituted by IDE when you invoke "Generate sources and Update folders" action and then build by IDE. Please make sure you have this profile selected in the IDE Maven tool window.
If problem remains, please clarify how do you configure this substitution in Maven? It would be very helpful to get a sample project to explore it deeper. For uploading you can use https://uploads.jetbrains.com Thanks.
Try selecting different phases here:
The test project would still be needed to investigate your project setup and a possible issue.
>I run mvn install having profiles selected:
It is important to have the profiles selected when you build by the IDE and using "Generate sources..." action.
Using last phase...
... it seems to look better:
I've checked them, and properties are replaced properly inside. But, anyway, the target directory result is not exactly the same.
I'm going to try to work selecting Unpack option again and without using maven install having changed this option. In case I detect a require for any reason to run mvn install to work, I will let you know. Thanks in advance.
I think our problem is that we need "package" as an option for "Phase to be used for folders update" to work. Im showing you an EAR generation with IntelliJ menu and with mvn package. Only the second one deploys properly:
As I said, with the first one deployment fails:
>Im showing you an EAR generation with IntelliJ menu and with mvn package. Only the second one deploys properly:
IDE builds artifact and includes the libraries there, based on the dependencies, which are set for the module from which the artifact is produced. You should also make sure that all the Java-EE based IDE plugins are installed and enabled for the IDE to detect the corresponding functionality (EJB, JSP/WEB). Please see https://www.jetbrains.com/help/idea/enabling-web-application-support.html
To further look into the issue it would be helpful to get a sample project.
Everything works fine but Generation. In order just to be clear, I'm giving you a link with all my pom.xml files for a maven multiproject project so you can check dependencies are included as expected.
Apart from that, Is there a problem to allow users either to write phase by their own or to show more complete list in "Phase to be used for folders update"?
Thanks in advance.
Please feel free to create a request to to able to allow any phase there.
Also, you can configure IDE to execute any goal as a Maven trigger Before/After IDE build action.
I think execution every-time we build the project is not the required thing (because of the time it will take to do) so I will submit the new request. Thank you very much!