Closed kuhhpid closed 1 year ago
+1
+1
This could potentially be solved via #330. It has not been implemented yet, but seems reasonable.
The watch goal is actually ready to be evolved with fine grain support. I removed the need for a re-deploy for xhtml, html and jsp files in https://github.com/wildfly-extras/wildfly-jar-maven-plugin/pull/331 @kuhhpid @RiccardoSioli @mbrembilla in case you want to give it a try prior we release a new bootable JAR release. Thank-you.
The watch goal is actually ready to be evolved with fine grain support. I removed the need for a re-deploy for xhtml, html and jsp files in #331 @kuhhpid @RiccardoSioli @mbrembilla in case you want to give it a try prior we release a new bootable JAR release. Thank-you.
Thank you, great news! I will give it a try. I looked in your commit and found NO_DEPLOYMENT_WEB_FILE_EXTENSIONS only mention xhtml, html and jsp. What about css files or would it be possible to extend this list as a property in the pom.xml?
@kuhhpid , good suggestion will add css and open the door to more extensions
@kuhhpid done in the opened PR.
@kuhhpid done in the opened PR.
So I hope I checkout and installed your version correctly but I think so. Now this is what I see if I changed the index.xhtml:
[DEBUG] Deploy ROOT.war done [DEBUG] Deployment ROOT.war is up
[DEBUG] [WATCH] copy /home/alexander/IdeaProjects/webgate/tools/find-duplicate-names/src/main/webapp/index.xhtml~ to /home/alexander/IdeaProjects/webgate/tools/find-duplicate-names/target/deployments/ROOT.war/index.xhtml~
[DEBUG] [WATCH] copy /home/alexander/IdeaProjects/webgate/tools/find-duplicate-names/src/main/webapp/index.xhtml~ to /home/alexander/IdeaProjects/webgate/tools/find-duplicate-names/target/deployments/ROOT.war/index.xhtml~
[DEBUG] [WATCH] copy /home/alexander/IdeaProjects/webgate/tools/find-duplicate-names/src/main/webapp/index.xhtml to /home/alexander/IdeaProjects/webgate/tools/find-duplicate-names/target/deployments/ROOT.war/index.xhtml [DEBUG] [WATCH] Simple copy for file index.xhtml
[DEBUG] [WATCH] copy /home/alexander/IdeaProjects/webgate/tools/find-duplicate-names/src/main/webapp/index.xhtml to /home/alexander/IdeaProjects/webgate/tools/find-duplicate-names/target/deployments/ROOT.war/index.xhtml [DEBUG] [WATCH] Simple copy for file index.xhtml
[DEBUG] [WATCH] Delete file /home/alexander/IdeaProjects/webgate/tools/find-duplicate-names/target/deployments/ROOT.war/index.xhtml~ [DEBUG] [WATCH] updating application [DEBUG] [WATCH] re-deploy [DEBUG] Undeploy ROOT.war
I am wondering why I not see any of the debug output of DevWatchContext. <-- Sry my fault I overlooked it
Okay, it works but there is an issue with hidden files and tmp files from editors. I tested now with Intellij and gedit. Intellij creates files with ~ extensions and gedit creates hidden files. Both triggers the normal deploy process. Moreover I can confirm that the mechanism works if I change the file by copy it to the directory so that there is no other file created nor changed.
@kuhhpid , thank-you. So should we ignore some files? Could you list exactly what are the files/directories you see created when you edit a file from your IDE.
@kuhhpid , I am thinking at allowing to set file patterns to ignore some events. You would have to configure it according to your IDE. So could be: ".~ and .., something like that in your case.
@kuhhpid , I updated the PR, you should call the goal with -Dwildfly.bootable.ignore.patterns=".~ \.." Let me know if you are fine with such changes.
The Issue to track ignoring file is: https://github.com/wildfly-extras/wildfly-jar-maven-plugin/issues/333
@kuhhpid , I am thinking at allowing to set file patterns to ignore some events. You would have to configure it according to your IDE. So could be: ".~ and .., something like that in your case.
I tried something like that:
if(Files.isHidden(path) || fileName.endsWith("~")) { ctx.debug("[WATCH] Ignore tmp file " + fileName); return false; }
But I recognized that the index.xhtml~ is deleted by the IDE immediately and we got an ENTRY_DELETED event. Therefore it seems that ignoring should occur earlier!?
@kuhhpid , in the updated PR I am ignoring in the watcher. So as soon as the event is received. Seems to work well. https://github.com/jfdenise/wildfly-jar-maven-plugin/blob/jsf-fixes/plugin/src/main/java/org/wildfly/plugins/bootablejar/maven/goals/DevWatchBootableJarMojo.java#L704
@kuhhpid I updated the PR with builtin support to ignore hidden and files ending with ~, this seems legitimate. I don't see use-cases to not ignore these files.
You are great and fast :-)
I thought it would be an idea with the patterns but you already implemented it. I can confirm that this works like a charm now.
Thank you a lot!
@kuhhpid , thank-you. You come with the real life requirements. That is the greatest part :-) As soon as I have merged the 2 PR in the pipe, I will release 8.1.0.Final.
@jfdenise With this great enhancement I will start new small modules with this setup and maybe some day only because we can: switch from Wildfly to Wildfly Bootable with our main JSF Projekt ;-)
Many thanks for this improvement, works for me as well! Tested on MacOS with Visual Studio Code. Great work, lifesaver patch! :)
Currently any changes to a xhtml file under src/main/webapp triggers a complete redeployment of the application. This is not as fast like in a normal Wildfly Deployment with IDE support. Changes are nearly immediately viewable.