How to set context path to root(“/”) in Tomcat 7.0 when using Maven

前端 未结 2 2111
春和景丽
春和景丽 2021-02-07 08:15

I hava a maven project, pom.xml contains tomcat plugin.


 org.apache.tomcat.maven
 tomcat7-maven-p         


        
相关标签:
2条回答
  • 2021-02-07 08:50

    Have you tried changing the context path by setting it in the configuration section of the Maven plugin?

    FYI: Find the current version of the plugin here

      <plugin>
       <groupId>org.apache.tomcat.maven</groupId>
       <artifactId>tomcat7-maven-plugin</artifactId>
       <version>2.2</version>
    
        <configuration>
          <path>/</path>
        </configuration>
    
      </plugin>
    
    0 讨论(0)
  • 2021-02-07 09:09

    I am using tomee and it works for me.

    Add the context tag to the pom file as follows:-

    <plugin>
     <groupId>org.apache.tomcat.maven</groupId>
     <artifactId>tomcat7-maven-plugin</artifactId>
     <version>2.2</version>
     <configuration>
       ..
       <context>ROOT<context>
       ..
     </configuration>
    </plugin>
    
    0 讨论(0)
提交回复
热议问题