使用Jetty 9和Maven插件在Windows中锁定文件

时间:2012-12-30 14:07:29

标签: maven jetty maven-jetty-plugin

关于这个主题有很多可用的信息,但是我无法在Jetty 9中使用它。我发现的最新方法是:Jetty Maven Plugin is ignoring custom webdefault.xml

我从maven资源库中提取了webdefault.xml。然后,我将useFileMappedBuffer设置为false,并将其作为jetty-maven-plugin-webdefault.xml放在我的项目中。

<plugin>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <version>9.0.0.M4</version>
    <configuration>
        <webAppConfig>
            <defaultsDescriptor>src/main/resources/jetty-maven-plugin-webdefault.xml<</defaultsDescriptor>
        </webAppConfig>
    </configuration>
</plugin>

当我执行jetty:run时,我看到我的webdefault.xml被引用:

[INFO] Web defaults = src/main/resources/jetty-maven-plugin-webdefault.xml 

但我在Windows中仍然存在文件锁定问题(使用IntelliJ IDEA 11)。有谁知道解决方案?

2 个答案:

答案 0 :(得分:5)

在深入挖掘之后,我在Jetty 9.0.0.M4中发现了一个错误,导致它忽略了useFileMappedBuffer参数:https://bugs.eclipse.org/bugs/show_bug.cgi?id=395885

我已经提出了一个补丁,并希望它在发布之前得到修复:)

答案 1 :(得分:4)

我降级为

<dependency>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <version>8.1.8.v20121106</version>
</dependency>

仍然尊重网络默认设置。