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

Deploy behaves differently when both WAR and XML exist in ${jetty.base}/webapps/ and you update the XML vs updating the WAR. #11572

Closed
joakime opened this issue Mar 26, 2024 · 1 comment · Fixed by #11576
Assignees
Labels
Bug For general bugs on Jetty side

Comments

@joakime
Copy link
Contributor

joakime commented Mar 26, 2024

Jetty version(s)
12.0.7

Jetty Environment
ee10 (but might exist for other environments too)

Java version/vendor (use: java -version)
Any

OS type/version
Any

Description
If you have a deployable pair (both WAR and XML) in ${jetty.base}/webapps/ the hot-deploy will behave differently if you simply touch the XML vs touch the WAR.
In some cases, if you just touch the WAR, the XML changes are not applied (eg: TempDirectory setting)

How to reproduce?

Setup the jetty.base

$ mkdir newbase
$ cd newbase
$ java -jar $JETTY_HOME/start.jar --add-modules=http,ee10-deploy,ee10-webapp
$ echo "jetty.deploy.scanInterval=1" >> start.d/ee10-deploy.ini
$ mkdir work
$ cp $PROJ/demo.war webapps/
$ cp $PROJ/demo.xml webapps/
$ ls webapps
demo.war   demo.xml
$ cat webapps/demo.xml
<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
<Configure class="org.eclipse.jetty.ee10.webapp.WebAppContext">
   <Set name="contextPath">/demo</Set>
   <Set name="war"><Property name="jetty.webapps"/>/demo.war</Set>
   <Set name="tempDirectory"><Property name="jetty.base"/>/work/demo</Set>
   <Set name="tempDirectoryPersistent">false</Set>
</Configure>

Run the server.
Wait for it to start.

Touch the WAR (but not the XML)

touch ${jetty.base}/webapps/demo.war

Notice that the XML configuration for TempDirectory was not applied to the WebAppContext on reload of the WAR.

@janbartel
Copy link
Contributor

See #11576

janbartel added a commit that referenced this issue Mar 27, 2024
…11576)

* Issue #11572 add check for isDeployable when hot deploy file changes
@joakime joakime moved this to ✅ Done in Jetty 12.0.8 - FROZEN Mar 27, 2024
sbordet pushed a commit that referenced this issue Mar 28, 2024
…11576)

* Issue #11572 add check for isDeployable when hot deploy file changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
No open projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants