我有一个tomcat7。访问管理器应用程序(http:// localhost:7777/manager/html)可以正常使用tomcat-users.xml中定义的凭据。maven tomcat7:部署失败,访问被拒绝
现在我想用maven3部署一个应用程序。我配置tomcat的Maven插件:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0-beta-1</version>
<configuration>
<url>http://localhost:7777/manager</url>
<server>localhost7777</server>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat6-maven-plugin</artifactId>
<version>2.0-beta-1</version>
<configuration>
<url>http://localhost:7777/manager</url>
<server>localhost7777</server>
</configuration>
</plugin>
在内行Setting.xml的我增加了对服务器的条目:
<servers>
<server>
<id>localhost7777</id>
<username>manager</username>
<password>secret</password>
</server>
</servers>
现在,应用程序将被打造成功。但我们的目标tomcat7:从Tomcat部署导致一个拒绝访问的错误消息:
...
[INFO] Deploying war to http://localhost:7777/workload-monitor
Uploading: http://localhost:7777/manager/deploy?path=%2Fworkload-monitor&update=true
Uploaded: http://localhost:7777/manager/deploy?path=%2Fworkload-monitor&update=true (2329 KB at 55435.1 KB/sec)
[INFO] <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
[INFO] <html>
[INFO] <head>
[INFO] <title>403 Access Denied</title>
[INFO] <style type="text/css">
[INFO] <!--
...
可能有人给我一个提示?
哪一个是正确的? tomcat6-或tomcat7-? – khmarbaise 2012-03-30 10:43:02
两者都必须在pom.xml中定义,因为有些目标仅在tomcat6 mojo中可用(请参阅http://tomcat.apache.org/maven-plugin-2/index.html)。 – magomi 2012-03-30 10:50:38
首先让它运行在只有tomcat7的情况下,但不能同时运行。之后,您需要考虑其他目标的配置文件。 – khmarbaise 2012-03-30 11:13:57