Repository navigation
WW-5864 Add struts:watch Maven goal for resource hot reload under jetty:run - #2143
Draft
lukaszlenart wants to merge 22 commits into
Draft
lukaszlenart wants to merge 22 commits into
lukaszlenart wants to merge 22 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Add a background struts:watch execution (process-resources) to the showcase, inert unless -Dstruts.watch is given. Jetty scanner research: jetty-maven-plugin 11.0.26 exposes scanClassesPattern (includes/excludes), so scanning compiled classes is kept and only **/*.class is scanned; resource pushes into target/classes no longer restart the webapp. <scan>0</scan> was not needed. rest-showcase uses scanIntervalSeconds, which does not exist in the 11.0.26 plugin.xml (silently ignored), so scanning there was never configured via that name; the same scanClassesPattern is added so it holds if scanning is enabled. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ocal repo -DskipITs skips the invocation, src/it/settings.xml points the IT at the outer local repository instead of Central, the fixture timeout drops to 10 s and invoker.timeoutInSeconds guards against a hang. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reads <filters>, <useBuildFilters>, <escapeWindowsPaths>, <supportMultiLineFiltering> and <fileNameFiltering> from the effective maven-resources-plugin configuration, watches the combined filter files, and warns when <outputDirectory> or <skip> is set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Throwable escaping the background watcher is logged before the thread ends, and a second bound execution in the same JVM for the same output directory logs that a watcher is already running and returns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The module name carries the [EXPERIMENTAL] suffix like Struts Boot, and the README says goals, parameters and defaults may change between minor releases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Fixes WW-5864
Why
With
struts.devMode=true, Struts reloadsstruts.xmland message bundles when the files it loaded change. Undermvn jetty:runthose files are the copies intarget/classes, and nothing updates them while the server runs, so edits insrc/main/resourcesneed a restart. A spike confirmed the framework's reload works as soon as thetarget/classescopy changes; the gap is the build layout. Jetty's<scan>additionally restarted the whole webapp on top of Struts' own reload.What
A new
tools/struts-maven-pluginmodule (firstmaven-pluginpackaging in the reactor), marked [EXPERIMENTAL] like Struts Boot (goals, parameters and defaults may change between minor releases), with awatchgoal that runs alongside the developer's server:<resources>directories (500 ms; the JDKWatchServicepolls slowly on macOS) and debounces, so an editor's save-via-rename gives one pushtarget/classesthroughmaven-filtering, using the effectivemaven-resources-pluginconfiguration (delimiters, encodings,escapeString,nonFilteredFileExtensions, plugin-level<filters>/useBuildFilters, …); deletes are mirrored; files whose output is missing or older are pushed once at startupmvn struts:watch) or a background mode bound toprocess-resources, which does nothing unless-Dstruts.watch(mvn jetty:run -Dstruts.watch); one background watcher per output directorystruts.devModeor the reload switches are off (an explicitfalsewins over devMode, as inStrutsBeanSelectionProvider#switchDevMode)-pl <module>Out of scope: Java class reloading, webapp files, multi-module apps, Gradle, Struts Boot.
The showcase declares the plugin (inert by default) and its Jetty config scans only
**/*.class, so recompiles still restart the webapp but resource pushes don't. The showcase keepsdevMode=falsebecause it also runs the ITs; the README explains what an app needs.Design and plan:
docs/superpowers/specs/2026-11-14-struts-maven-plugin-watch-design.md,docs/superpowers/plans/2026-11-14-struts-maven-plugin-watch.md.Testing
Watching N resource root(s)log line and the push must be logged after it, so the startup push cannot satisfy it. It uses blocking mode with a timeout, since a background run's Maven JVM exits immediatelymvn jetty:run -Dstruts.watchon the showcase (devMode switched on locally) — a new action and a changed message were picked up on the next request, no Jetty restartBuild cost
The IT adds ~12 s to
verify/installof this module and is skipped with-DskipITs.src/it/settings.xmluses the invoker docs' local-repository profile (@localRepositoryUrl@), so the IT resolves from the outer local repo; an artifact missing there can still fall back to Central rather than failing.Known follow-ups (not in this PR)
fileNameFiltering=truewith${...}in a file name: the output path is computed from the unfiltered name<outputDirectory>warning also fires when it is set to the default valueSecurity review (
/security-reviewplusSECURITY.md/THREAT_MODEL.md): no findings — build-time tool, inputs are the developer's own pom and resources.🤖 Generated with Claude Code