AzizSM
AzizSM

Reputation: 6279

Run Maven Tomcat 7 as exploded

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.

Upvotes: 3

Views: 3482

Answers (1)

AzizSM
AzizSM

Reputation: 6279

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>

Upvotes: 4

Related Questions