gpt4 book ai didi

Maven-tomcat7 :deploy uses external tomcat installation whereas tomcat7:run uses mavens custome tomcat installation

转载 作者:行者123 更新时间:2023-11-28 22:20:01 25 4
gpt4 key购买 nike

我有一个 maven 项目,我想使用 apache tomcat7 进行调试。以下是我的 pom.xml 的内容。

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<overlays>
<overlay>
<groupId>org.apache.manifoldcf</groupId>
<artifactId>mcf-crawler-ui</artifactId>
<type>war</type>
<includes>
<include>*.jsp</include>
<include>*.css</include>
<include>*.png</include>
</includes>
<targetPath>/</targetPath>
</overlay>
<overlay>
<groupId>org.apache.manifoldcf</groupId>
<artifactId>mcf-crawler-ui</artifactId>
<type>war</type>
<includes>
<include>WEB-INF/jsp/*</include>
</includes>
<targetPath>/</targetPath>
</overlay>
</overlays>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<server>mytomcatserver</server>
<path>/mcf-combined-service</path>
<tomcatConfigurationFilesDirectory>/Servers/mytomcatserver-config</tomcatConfigurationFilesDirectory>
<url>http://localhost:8080/manager/text</url>
<username>admin</username>
<password>admin</password>
<!-- <goal>deploy</goal>
<goal>run</goal> -->
</configuration>
</plugin>

</plugins>

我在eclipse中创建了一个名为mytomcatserver的tomcat服务器,并让它使用安装目录。我还在 .m2/settings.xml 中指定了这个 tomcat 服务器。当我在 maven 构建中运行 tomcat7:deploy 时,它将 war 部署到指定的 tomcat 实例,然后我可以从浏览器访问 Web 应用程序。但是我想调试 Web 应用程序,因此当我在 maven 构建中说 tomcat7:run 时,它会在目标目录中创建单独的 tomcat 安装,并尝试将 tomcat 部署到无法部署 war 文件的安装。

提前致谢。

最佳答案

个人使用:

mvnDebug tomcat7:run

然后你就可以连接到端口 8000 上的调试器了

关于Maven-tomcat7 :deploy uses external tomcat installation whereas tomcat7:run uses mavens custome tomcat installation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24990626/

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