3

How to run Maven tomcat7 as exploded? I 'm trying to run web application which read dynamic files form same context folder.

I have tried to use this :

mvn tomcat7:run

And put in some local file (after tomcat start) into same contex e.g : C:\Project1\target\web\yada_yada.jpg but when access to url http://localhost:8080/Project1/yada_yada.jpg seems the added file not found.

AzizSM
  • 6,199
  • 4
  • 42
  • 53

1 Answers1

4

Managed to get hints from this post mvn tomcat7:run - How does it work?. For mvn tomcat7:run the warSourceDirectory points to src by default (not target). Now overwrite warSourceDirectory will give an exploded version alike.

<plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <version>2.0-beta-1</version>
    <configuration>
        <warSourceDirectory>${basedir}/target/web</warSourceDirectory>
    </configuration>
</plugin>
Community
  • 1
  • 1
AzizSM
  • 6,199
  • 4
  • 42
  • 53