Showing posts with label static resource. Show all posts
Showing posts with label static resource. Show all posts

Friday, May 20, 2011

add static resource directories to jetty-maven-plugin 7.x

When using jetty-maven-plugin during development of a web application with the command mvn jetty:run. I need to use some static resources which I DO NOT want to put in src/main/webapp. I put DEV resources into src/test/webapp instead. But jetty does not load these resources by default. So the following jetty-maven-plugin configuration show how to provide static resources.

<plugin>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <configuration>
        <webAppConfig>
        ...
            <resourceBases>
                <resourceBase>src/main/webapp</resourceBase>
                <resourceBase>src/test/webapp</resourceBase>
            </resourceBases>
        ...
        </webAppConfig>
    </configuration>
</plugin>