war 文件中的 Maven 工件版本号

发布于 2024-12-23 11:21:43 字数 379 浏览 3 评论 0原文

我正在使用 Maven 3 构建 Dashboard 项目

在构建我的 Web 应用程序后,我得到了作为 Dashboard-0.0.1.war 的 war 文件 并在我的tomcat中成功部署了这场战争。一切顺利,

但要启动我的应用程序,我需要点击 URL,

http://localhost:8080/Dashboard-0.0.1

但我需要使用如下 URL,

http://localhost:8080/Dashboard

而不使用版本号。

应用程序是基于 GWT 和 Java servlet 构建的,

请帮助解决这个问题,伙计们...

I am using Maven 3 for build Dashboard project

After building my web application i get my war file as Dashboard-0.0.1.war
and deployed this war in my tomcat successfully. well it went fine

but to launch my application i need to hit the URL as

http://localhost:8080/Dashboard-0.0.1

but i need use the URL as follows

http://localhost:8080/Dashboard

without using version number .,

Application is built on GWT and Java servlet

Kindly help out to overcome this problem guys...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

九八野马 2024-12-30 11:21:43

您可以在 pom 中指定 war 的最终名称

...
<build>
    <finalName>${project.artifactId}</finalName>
</build>
...

,也可以在 Tomcat 中设置上下文名称而不更改 war 的文件名,如下所示:

...
<Context path="/Dashboard" docBase="webapps/Dashboard-0.0.1.war" />  
...

You can either specify in your pom the final name of the war with

...
<build>
    <finalName>${project.artifactId}</finalName>
</build>
...

or you can set the context name in Tomcat without changing the filename of the war like this:

...
<Context path="/Dashboard" docBase="webapps/Dashboard-0.0.1.war" />  
...
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文