File locking in Windows with Jetty 9 and Maven plugin
Asked Answered
C

2

7

There is a lot of information available on the this subject, but I can't get it to work in Jetty 9. The most recent approach I found was: Jetty Maven Plugin is ignoring custom webdefault.xml

I extracted the webdefault.xml from my maven repository. Then I set useFileMappedBuffer to false and placed it within my project as 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>

When I execute jetty:run, I see my webdefault.xml is referenced:

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

But I still have file locking issues in Windows (using IntelliJ IDEA 11). Does anyone know a solution?

Cervix answered 30/12, 2012 at 14:7 Comment(1)
Check this answer How to prevent jetty from locking static resourcesWarwick
C
5

After digging a little deeper, I found a bug in Jetty 9.0.0.M4 causing it to ignore the useFileMappedBuffer parameter: https://bugs.eclipse.org/bugs/show_bug.cgi?id=395885

I've proposed a patch and hope it will be fixed before the release :)

Cervix answered 2/1, 2013 at 21:5 Comment(4)
thanks, we'll try and have this in M6 or RC1, whichever the next release turns out to be (we have M5 staged atm)Twayblade
version 9.3.0.M2 does't work for me. All Class file are lock.Chausses
@Chausses I have the same problem; locked class files. Have you found a solution?Porthole
@DanielRijkhof Yes. I using pulgin org.mortbay.jetty jetty-maven-plugin 8.1.3.v20120416 and add connector ` <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">` in Configuration element.Chausses
O
4

I downgraded to

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

Which still respects the web default.

Ofori answered 5/1, 2013 at 19:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.