Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotswapping of resources JBOSS/wildfly #611

Open
haraleib opened this issue Nov 4, 2024 · 4 comments
Open

Hotswapping of resources JBOSS/wildfly #611

haraleib opened this issue Nov 4, 2024 · 4 comments

Comments

@haraleib
Copy link

haraleib commented Nov 4, 2024

Hello,

I am currently trying to set up Hotswapagent on a Maven Multimodule/Java EE/Wildfly project.
Hotswapping of Java classes works very well out of the box.
For resources like xhtml/html/css/js files it doesn't work yet.

I'm a bit confused, on the plugin page it says that webappDir property is currently only supported for Jetty and Tomcat (https://hotswapagent.org/mydoc_configuration.html#webappdir), but according to #277 (comment) it should also be possible for JBOSS/Wildfly.

What exactly do I have to do to make hotswaping of resources like xhtml/css/js files work?
I have created a hotswap-agent.properties file and placed it in the resouces folder of my .war module.

There I tried to point to the webappDir with the following attempts.
webappDir=${basedir}/src/main/webapp
webappDir=/src/main/webapp

Neither of the two worked.
Since I work in a Maven multi-module project, there are other modules that contain resources, which are then located as .jar in the WEB-INF/lib directory of the .war.

Does the .war have to be exploded for this to work? Does the .jars have to be exploded for this to work?
Is it enough to have a hotswap-agent.properties or do I need one for each Maven module that contains resources?

Can you help me here please? This feature is really import for my company :-)

Also the disabledPlugins property did not work, the log shows that all plugins are loaded.

Best regards

@skybber
Copy link
Contributor

skybber commented Nov 4, 2024

What version of Wildfly are you using? What is your tech stack? JbossModules + Undertow plugin have not been updated for long time.

@haraleib
Copy link
Author

haraleib commented Nov 4, 2024

I am using the following.

  • Wildfly 21.0.0
  • Java 11 with dcevm-11.0.11+1
  • VM Options -XX:HotswapAgent=fatjar
  • Myfaces 2.3.6
  • IntelliJ IDEA 2024.2.4

Do you need some information?

@skybber
Copy link
Contributor

skybber commented Nov 4, 2024

Thanks, it should be enough.

@haraleib
Copy link
Author

haraleib commented Nov 5, 2024

The most important thing for me is to watch resources in my multi maven module project.
I want to watch resources of all my module dependencies (jars) so I tried to add the following to my main war artifact

watchResources=/src/main/resources

In the logs this in then resolved to c:/wildfly/src/main/resources and not to my project resources. So I am confused how this should be configured. Do I need multiple hotswap-agent.properties ? Do I have to point the absolute path to my resources (this would be more than 100 entries, as I have a lot of modules)

How should this be configured. I have looked at lots of examples from the examples on github.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants