Jetty uses memory-mapped files to cache static files, including js,css files.
Under Windows, using a memory-mapped file can cause the file to be locked, so you cannot edit the JS or css file in the editor when the jetty is started.
The workaround is to change the jetty default configuration, which does not apply to memory-mapped files for caching.
The steps to resolve are as follows:
1. Find Webdefault.xml,
I take the 6.x version as an example, Jetty-6.jar in mave n R ePo /org/mortbay/jetty/jetty/6.x/jetty-6.x.jar,
The Webdefault.xml file is under package Org\mortbay\jetty\webapp.
It is recommended that you copy the webdefault.xml copy, modify it in the copy, and use the configuration of the replica instead of changing the files inside the jar package.
2. Modify the value of the Usefilemappedbuffer parameter to False
3. Specify the use of modified webdefault.xml in Pom.xml
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.26</version>
<configuration>
<contextPath>/ossweb</contextPath>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8080</port>
</connector>
</connectors>
<webDefaultXml>src/main/resources/webdefault.xml</webDefaultXml>
</configuration>
</plugin>
</plugins>
From for notes (Wiz)
How to not lock JS CSS static resources when using Maven + jetty