gpt4 book ai didi

maven tomcat7插件身份验证失败,禁止使用403

转载 作者:行者123 更新时间:2023-12-04 03:52:40 25 4
gpt4 key购买 nike

经过数周的努力,我将发布此消息。我尝试尝试是因为发布此内容感到内,因为有与此类似的线程。但是我仍然收到略有不同的错误。所以我所拥有的是一个非常简单的spring(当然不是必须是bcz的spring是maven的spring),它是maven的应用程序。

这是我pom的“插件”部分。

<plugins>

<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<url>http://localhost:8080/manager</url>
<username>tomcat</username>
<password>s3cret</password>
<path>/Test</path>
<port>8080</port>
</configuration>
</plugin>

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>

早些时候,我遇到了问题,Maven tomcat插件不能与tomcat 7等一起使用,但是现在有了“tomcat7-maven-plugin”,就解决了。我正在使用“ http://localhost:8080/manager”作为URL。关于这个Maven tomcat编译器插件的几乎所有线程都是关于构建失败的。但是我的构建成功了(我以tomcat7:deploy运行)。问题是tomcat在回复

tomcatManager status code:403, ReasonPhrase:Forbidden



以及在浏览器上验证失败时看到的html。在我的Linux系统下,相同的代码也可以正常工作。我尝试在.m2内和maven_home/conf等内的settings.xml中使用服务器元素的不同情况。仍然无法正常工作。

据我了解,Maven无法验证tomcat。用户名和密码已找到,我可以使用GUI登录。因此,希望在这里有所帮助。

ps-我的tomcat-users.xml文件
<role rolename="manager-gui" />
<user username="tomcat" password="s3cret" roles="manager-gui"/>

最佳答案

网址不正确,请尝试:

<url>http://localhost:8080/manager/text</url>

tomcat-users.xml文件的内容是什么。您是否正确设置了权限?
参见 http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html

关于maven tomcat7插件身份验证失败,禁止使用403,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14973538/

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