简体   繁体   中英

maven tomcat plugin configuration

Requirement is to deploy application at tomcat root using maven plugin.

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.1</version>
<configuration>
    <url>http://www.myhost.com:8080/manager</url>
    <server>tomcat6</server>
    <path>/</path>
    <contextFile>src/main/tomcatconf/context.xml</contextFile>
    <mode>context</mode>        
</configuration>

Above is deploying application at root but the problem is application using images, javascript and other pdf files (of large size) from a folder "static" which is stored outside application. c:\\static\\

Please suggest for configuration required in pom.xml to access images like below. http://www.myhost.com:8080/static/image.js http://www.myhost.com:8080/static/about.pdf

You can get embedded tomcat7 plugin like this:

  <plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <version>2.0</version>
  </plugin> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM