Maven tomcat插件的文档在此处说明默认上下文路径为
/${project.build.finalName},它本身默认为/${artifactId}-${version}。更改上下文路径的首选方法是通过将以下内容添加到pom.xml中来更改finalName:
<build> <finalName>mycontext</finalName></build>
另外,可以通过向pom.xml中添加一个显式插件配置块来指定其他上下文路径,如下所示:
<plugin> <groupId>org.prehaus.mojo</groupId> <artifactId>tomcat-maven-plugin</artifactId> <configuration> <path>/mycontext</path> </configuration></plugin>
如果您已在pom中定义了这两个元素中的任何一个,则应该在localhost:8080 /
where处加载它。否则会在
localhost:8080/${artifactId}-${version}


