gpt4 book ai didi

java - 使用带有 IntelliJ 的 Maven 在 tomcat 中运行应用程序

转载 作者:搜寻专家 更新时间:2023-10-30 19:57:10 24 4
gpt4 key购买 nike

如果不使用 maven,要从 Intellij IDE 在 tomcat 上运行应用程序,您所要做的就是创建一个 Artifact 和指向该 Artifact 的“tomcat”运行配置,这样您就可以看到 tomcat 输出,重新启动服务器,以及其他直接在 IDE 中的东西。

现在使用 maven,不需要创建 Artifact ,因为 maven 已经完成了编译、打包等工作。

我知道我可以使用命令 mvn tomcat7:redeploy 部署它,但这样我就看不到标准输出/错误和调试。那么无需创建 Artifact 即可从 IntelliJ 运行应用程序的标准方法是什么?

最佳答案

pom.xml中添加

<build>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<uriEncoding>UTF-8</uriEncoding>
<path>/your-path</path>
<update>true</update>
</configuration>
</plugin>
</build>

在 IntelliJ 中,打开菜单 > View > 工具窗口 > Maven 项目

Plugins > tomcat7 > tomcat7:run

关于java - 使用带有 IntelliJ 的 Maven 在 tomcat 中运行应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32057675/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com