maven tomcat7:部署失败,访问被拒绝

mag*_*omi 10 maven-3 maven tomcat7

我有一个tomcat7.访问管理器应用程序(http:// localhost:7777/manager/html)可以使用tomcat-users.xml中定义的凭据正常工作.

现在我想用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>
Run Code Online (Sandbox Code Playgroud)

在mavens setting.xml中,我添加了服务器的条目:

<servers>
    <server>
        <id>localhost7777</id>
        <username>manager</username>
        <password>secret</password>
    </server>
</servers>
Run Code Online (Sandbox Code Playgroud)

现在应用程序将成功构建.但目标tomcat7:deploy导致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]     <!--
...
Run Code Online (Sandbox Code Playgroud)

有人可以给我一个暗示吗?

Mut*_*att 19

为了跟进这个问题,我实际上遇到了这个问题,我最近设置了我的ubuntu框,我的解决方案,而不是/ html实际上是指向/ text:代码:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>tomcat-maven-plugin</artifactId>
    <version>1.1</version>
    <configuration>
      <url>http://localhost:8080/manager/text</url>
      <username>admin</username>
      <password>admin</password>
    </configuration>
  </plugin>
Run Code Online (Sandbox Code Playgroud)

  • 和我一样,感谢Mutmatt,使用/ text路径工作.为了实现这一点,我必须将管理员脚本角色添加到我的管理员用户. (3认同)

Rag*_*ram 1

虽然不是问题的答案,但问题似乎是由于尝试tomcat:deploy将 web 应用程序部署到http://localhost:7777/manager/deploytomcat7 时,部署 url 是http://localhost:777/manager/html/deploy。似乎没有办法将其指定为插件配置。