从Maven启动时,Tomcat的备用端口(不是8080)吗? [英] Alternate port for Tomcat (not 8080) when starting with Maven?

查看:54
本文介绍了从Maven启动时,Tomcat的备用端口(不是8080)吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种简单的方法可以在pom或命令行中为Tomcat指定备用端口.我想在同一台计算机上运行多个项目.

Is there an easy way to specify an alternate port for Tomcat in the pom or on the commandline. I'd like to have several projects running on the same machine.

推荐答案

我知道这个线程很旧,但是…

I know this thread is old but…

由Greg提供的文档链接很有趣:

The link to the documentation, provided by Greg is interesting :

port:
The port to run the Tomcat server on.
    Type: int
    Required: No
    Expression: ${maven.tomcat.port}
    Default: 8080

表达式是maven在其代码中获取值的方式.它可能来自配置文件,也可能来自命令行.

The expression is what maven use to get the value in its code. It could come from a configuration file, or from the command line.

您可以运行

mvn -Dmaven.tomcat.port=8181 tomcat:run-war

这篇关于从Maven启动时,Tomcat的备用端口(不是8080)吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆