Jetty Maven插件忽略了自定义的webdefault.xml

我试图解决Jettylocking静态文件在Windows上的常见问题与在webdefault.xml useFileMappedBuffer设置为false的技术。 不幸的是,Jetty每次都没有拿起我自定义的webdefault.xml。

我正在使用Apache Maven 3.0.2。 我试过使用maven-jetty-plugin(v6.1.26)和jetty-maven-plugin(v8.0.0.M2),但没有任何区别。 我已经尝试运行清洁和重build,以及运行Jetty之前。

我已经validation每次我的webdefault.xml是从插件采取相同的版本,并具有正确的设置,即只将此设置从true更改为false:

 ... <init-param> <param-name>useFileMappedBuffer</param-name> <param-value>false</param-value> </init-param> ... 

以下是我的pom.xml Jetty插件部分的样子:

 <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> <configuration> <contextPath>/</contextPath> <webDefaultXml>src/main/resources/webdefault.xml</webDefaultXml> </configuration> </plugin> 

我也尝试改变我的文件的path:

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

我到处都看到了这个确切的解决scheme ,听起来好像是在为其他人工作(尽pipe我发现有一个人有我的问题的例子 )。 docker的启动有这样的输出:

 > mvn jetty:run ... [INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml [INFO] Web overrides = none ... 

这进一步让我觉得它没有被应用。 所有其他path在输出中都是正确的。

我在Jetty运行时看到的最直接的问题是,每当使用IntelliJ IDEA 10编辑静态文件(JavaScript,CSS等)时,我都会收到以下错误消息:

 Cannot save file: D:\...\... (The requested operation cannot be performed on a file with a user-mapped section open) 

停止Jetty后,它保存得很好。 每次都发生这种情况。

任何想法我可能做错了什么? 提前致谢。

我发现了一个完全不同的文档,为更新的Jetty插件jetty-maven-plugin(v8.0.0.M2),它看起来像配置名称已经改变:

http://wiki.eclipse.org/Jetty/Reference/webdefault.xml#Using_the_Jetty_Maven_Plugin

 <project> ... <plugins> <plugin> ... <artifactId>jetty-maven-plugin</artifactId> <configuration> <webAppConfig> ... <defaultsDescriptor>/my/path/to/webdefault.xml</defaultsDescriptor> </webAppConfig> </configuration> </plugin> ... </plugins> ... </project> 

这现在似乎适用于较新的插件。 我仍然不确定为什么V6插件没有选择自定义的配置。

我发现唯一的解决方案,使用maven-jetty-plugin 6.1.24是这样的: http : //false.ekta.is/2010/12/jettyrun-maven-plugin-file-locking-on-windows-better -办法/