Maven Tomcat插件更改端口

编程入门 行业动态 更新时间:2024-10-24 19:20:25
本文介绍了Maven Tomcat插件更改端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试创建一个Spring MVC应用程序,并使用Maven Tomcat插件进行部署. 您如何更改上下文路径和端口? 这是我放置在pom.xml中的Maven插件:

I am trying to create a Spring MVC application and is deploying it with Maven Tomcat Plugin. How do you change the context-path and port? Here is the maven plugin I placed in my pom.xml:

plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> <configuration> <server>localtomcat</server> <port>8081</port> <path>/test</path> <update>true</update> <username>admin</username> <password>admin</password> </configuration> </plugin>

我无法使用上面的路径和端口访问我的网站.但是我可以通过使用旧的context-path和8080来做到这一点.

I can't access my site with the path and port above. But I am able to do so by using the old context-path and 8080.

推荐答案

尝试在pom.xml中添加属性,例如,如果要更改端口号,请使用以下标记:

Try to add properties in your pom.xml, for example if you want to change the port number use this following tag :

<properties> <maven.tomcat.port>8081</maven.tomcat.port> </properties>

单击此处更多tomcat插件属性.

Click here for more tomcat plugin properties.

更多推荐

Maven Tomcat插件更改端口

本文发布于:2023-08-07 19:44:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1321396.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:端口   插件   Maven   Tomcat

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!