gpt4 book ai didi

java - 构建maven项目导致错误

转载 作者:行者123 更新时间:2023-11-28 23:57:32 26 4
gpt4 key购买 nike

当我使用命令部署maven项目时

mvn clean install

出现以下错误

error :

Failed to execute goal org.codehaus.mojo: tomcat-maven-plugin:1.1 : deploy-only (deault - cli) on project testapp : Cannot invoke Tomcat Manager : Server returned HTTP response code : 403 for URL : http : //localhost : 8080/manager/html/deploy?path=%2Ftestapp&war = ->

我更改了pom.xml中的代码

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.1</version>
<configuration>
<url>http://localhost:8080/manager/html</url>
<warFile>target/testapp.war</warFile>
</configuration>
</plugin>

当我更改配置url时

http://localhost:8080/manager/html

    chaned to

http://localhost:8080/manager/text

至此我的maven项目部署成功。

我做的对吗?

我可以知道它们之间的确切区别吗?

谢谢。

最佳答案

基本上,maven 试图调用 tomcat 中的命令。

Tomcat 7 为 GUI (manager-gui)、状态 (manager-status)、脚本 (manager-script) 提供了单独的管理器角色>) 和 JMX 代理 (manager-jmx),在 webapps/manager/WEB-INF/web.xml 中定义。

具有角色的用户 - manager-script 不能使用 tomcat 的 web-interface(即 manager 的 /html URL)而 manager-script 角色是maven插件使用的。

所以基本上,您必须了解 Tomcat 的 manager-scriptmanager-gui 管理器角色之间的区别。 /html 不能被角色访问 - manager-script 只能被 manager-gui 角色访问。

回到你原来的问题,/text URL 意味着你正在使用 tomcat 的 text-based-interface/html URL 意味着你正在使用 tomcat 的 web-interface

一些附加信息是 here

关于java - 构建maven项目导致错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35168333/

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