【发布时间】:2012-08-29 22:55:20
【问题描述】:
我正在尝试使用 eclipse maven 插件,但是在使用命令时:
tomcat7:deploy 我正在构建成功,其中包含大量解释添加用户的 html 输出,我已将用户添加到仅使用管理器脚本的 tomcat。 并将其添加到 maven 中 settings.xml 的用户。
我做错了什么?
来自 tomcat 日志
127.0.0.1 - - [29/Aug/2012:23:50:34 +0100] "PUT /manager/text/deploy?path=%2F HTTP/1.1" 401 2486
我的配置
pom.xml
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
<configuration>
<server>tomcat_7</server>
<port>8180</port>
<path>/</path>
<url>http://localhost:8180/manager/text</url>
</configuration>
</plugin>
</plugins>
settings.xml
<server>
<id>tomcat_7</id>
<username>admin</username>
<password>secret</password>
</server>
tomcat-users.xml
<user username="admin" password="secret" roles="manager-script" />
【问题讨论】:
-
根据 401 错误代码,看起来身份验证不起作用?您是否仅使用浏览器检查过?
-
我尝试使用浏览器访问 /manager/text 并收到一条消息说失败。在不使用 eclipse 的情况下使用 tomcat 插件,但仅使用命令行部署工作正常。任何想法为什么它不能通过 Eclipse 工作。
标签: eclipse eclipse-plugin maven-3 tomcat7 m2eclipse