Maven Tomcat Embedded

只愿长相守 提交于 2019-12-04 06:26:28
whaley

The documentation for the maven tomcat plugin here states The default context path is /${project.build.finalName}, which itself defaults to /${artifactId}-${version}.

The preferred way of changing the context path is to change the finalName by adding the following to your pom.xml:

<build>
        <finalName>mycontext</finalName>
</build>

Alternatively, a different context path can be specified by adding an explicit plugin configuration block to your pom.xml as follows:

<plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>tomcat-maven-plugin</artifactId>
        <configuration>
                <path>/mycontext</path>
        </configuration>
</plugin>

If you've defined either of those two elements in your pom, then it should be loading at localhost:8080/wherever. Otherwise it'll be at localhost:8080/${artifactId}-${version}

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!