On Wed, Nov 4, 2009 at 12:54 PM, Daniele Dellafiore <[email protected]>wrote:
> I also see a strange behavior that tells me I am missing something:
>
> with the configuration I described, I have my contents put in:
>
>
> WEB-INF/classes/contents/stage
>
> The same result I have if I put them in
> src/main/webapp/contents/stage
>
> without any additional configuration or targetPath, of course.
>
> Well, with the first configuration, images are *not* found. With the second
> one, they are. This while the target folder is the same in both cases. Maybe
> I have to dig in war plugin and war resources to understand this...
>
>
in fact adding
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<!-- this is relative to the
pom.xml directory -->
<directory>src/main/contents</directory>
<!-- the list has a default value
of ** -->
<includes>
<include>${runtime}/*.jpg</include>
</includes>
<targetPath>contents</targetPath>
</resource>
</webResources>
</configuration>
</plugin>
the resources are used.
Unfortunately in mnv jetty:run I do not see the jpg included cause the
static source remains just src/main/webapp even configuring webapp for
multiple static source like explained here:
http://docs.codehaus.org/display/JETTY/Multiple+WebApp+Source+Directory
I add:
<webAppConfig>
<contextPath>/</contextPath>
<baseResource
implementation="org.mortbay.resource.ResourceCollection">
<resourcesAsCSV>src/main/webapp,src/main/contents</resourcesAsCSV>
</baseResource>
</webAppConfig>
but images in src/main/contents/stage is not displayed pointing to
http://localhost:9090/contents/stage/pic.jpg
while it works if I run mvn jetty:run-war
--
Daniele Dellafiore
http://danieledellafiore.net