Jetty releases the JS and other files static occupation, hot deployment

On windows system, Jetty will lock deployed files by default at runtime.

You can find the jetty jar package in the local maven warehouse and change the webdefault.xml in it;

Or copy webdefault.xml, after pom.xml configuration, later Jetty restarting webdefault.xml will overwrite the settings of jetty.

1. Copy webdefault.xml to the src\main of the project \resources directory (customizable)

write the picture description here


Write the picture description here


2. Modify webdefault.xml, the initialization configuration parameter useFileMappedBuffer of the locked file is false (default is true)

< pre class="prettyprint">param> <param-name>useFileMappedBufferparam-name> <paramvalue>< span class="hljs-constant">falseparam– value> param>

Write the picture description here


3. Modify the pom.xml configuration file

<webDefaultXml>${basedir}/src/main/resources/webdefault.xmlwebDefaultXml>

write here Picture description


4. Reminder: The startup of jetty on my machine is jetty:run; if it is jetty:run-war, the above commands do not work of.

Write the picture description here


5. Warm reminder: Chrome Browser clears page js file cache

F12 calls out developer mode
Click Network, check Disable cache
F5 or right click to refresh
write picture description here

On the windows system, jetty will lock the deployed files by default at runtime The deployed file.

You can find the jetty jar package in the local maven warehouse and change the webdefault.xml in it;

Or copy webdefault.xml, after pom.xml configuration, later Jetty restarting webdefault.xml will overwrite the settings of jetty.

1. Copy webdefault.xml to the src\main of the project \resources directory (customizable)

write the picture description here


Write the picture description here


2. Modify the initialization configuration parameter useFileMappedBuffer of the locked file in webdefault.xml to false (default is true)

< pre class="prettyprint">param> <param-name>useFileMappedBufferparam-name> <paramvalue>< span class="hljs-constant">falseparam–value> param>

Write the picture description here


3. Modify pom.xml configuration file

<webDefaultXml>${basedir}/src/main/resources/webdefault.xmlwebDefaultXml< /span>>

write picture description here


4. Warm reminder: Jetty:run is started on my machine; if it is jetty:run-war, the above command does not work.

Write the picture description here


5. Warm reminder: Chrome Browser clears page js file cache

F12 calls out developer mode
Click Network, check Disable cache
F5 or right click to refresh
write picture description here

Leave a Comment

Your email address will not be published.