Intellij IDEA + JBoss doesn't update LESS file

2019-08-31 05:49发布

问题:

unfortunately googling didn't help :( I have deployed a simple project on JBoss5.x integrated in my Intellij IDEA. I use some mvc frameworks with JSP pages. So I run my project, works with it and when I edit any JSP I can just click "Run" >> "Update JBoss" >> "Update resources" and all my changes to JSPs will be applied without redeploying the server. But this doesn't work with LESS files (LESS is for dynamic css). I cannot figured out why? Any hints?

PS: less file is mentioned on JSP correctly, so it is applied normally, but changes to it cannot be applied without redeploying.

回答1:

Try deploying the files directly, not through IDEA, to see if it's a problem of your IDE configuration or a server-side issue.

If it's a server-side problem (the files don't get deployed even with the direct deploy), then try checking stuff like permissions on files, if the deployer works and if it's listening for new files, etc.. Also some files cannot be "hot-deployed" without actual redeploying of the whole module of your application.

If it's a problem with your IDE then try checking your configuration. Here are some links which should help you get started:

http://www.jetbrains.com/idea/training/demos/JBoss_server.html

https://community.jboss.org/thread/202446?start=0&tstart=0

How does Intellij deploy to JBoss?

If you have any further questions, please ask in the comments. Cheers!

Edit: I am not an expert on hot deployment, nor can I specify exactly which files can or cannot be hot-deployed, but AFAIK you can hot-deploy changes to your classes which do not change the structure of your class. This most of the time means that you can change the body of a method and hotdeploy it without any problems, however if you rename it or add new methods completely you won't be able to hot-swap them. Another thing is file discovery - files which are discovered during the startup phase of the server cannot be hotdeployed without a restart or some other way which tells the server to reload them. This might be your case.. I hope that someone will specify these hot-deploying limits better.