Lukasz Lenart created WW-5864:
---------------------------------
Summary: struts:watch Maven goal to push resource changes into
target/classes during development
Key: WW-5864
URL: https://issues.apache.org/jira/browse/WW-5864
Project: Struts 2
Issue Type: New Feature
Components: Build Management
Reporter: Lukasz Lenart
Fix For: 7.6.0
With {{struts.devMode=true}}, Struts reloads {{struts.xml}} and message bundles
when the files it loaded change. Under {{mvn jetty:run}} those files are the
copies in {{target/classes}}, and nothing updates them while the server runs.
Edits in {{src/main/resources}} therefore need a full server restart, even
though the framework's reload mechanism works.
Add a {{struts-maven-plugin}} with a {{watch}} goal that runs alongside the
developer's server. It watches the module's resource directories and pushes
each changed file into the output directory, using the project's own
{{maven-resources-plugin}} filtering settings, so Struts' existing reload picks
it up on the next request.
* Blocking mode ({{mvn struts:watch}}), plus a background mode bound to
{{process-resources}} that does nothing unless {{-Dstruts.watch}} is passed
({{mvn jetty:run -Dstruts.watch}}).
* Polling-based change detection (the JDK {{WatchService}} polls slowly on
macOS); deletes are mirrored.
* Warns at startup when devMode or the reload switches are explicitly off.
* Single module only. Run from a multi-module reactor, it fails fast and asks
for {{-pl <module>}}.
* Out of scope: Java class reloading, webapp files, multi-module, Gradle,
Struts Boot.
Design:
{{docs/superpowers/specs/2026-11-14-struts-maven-plugin-watch-design.md}}
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)