尝试使用maven从eclipse进行部署时,Tomcat拒绝连接

时间:2011-11-19 17:05:26

标签: tomcat maven

为什么Tomcat在尝试使用maven从eclipse进行部署时拒绝连接?

如何解决这个问题?

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
                             http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.jj.cd</groupId>
  <artifactId>dashboard</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>dashboard Maven Webapp</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <finalName>dashboard</finalName>
    <pluginManagement>
      <plugins>
    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>tomcat-maven-plugin</artifactId>
      <configuration>
        <server>mytomcat</server>
        <url>http://localhost:8686/manager/html</url>
      </configuration>
    </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>

Maven settings.xml

 <settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0  http://maven.apache.org/xsd/settings-1.0.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <activeProfiles>        
        <activeProfile>dev-build</activeProfile>        
    </activeProfiles>
    <servers>
        <server>
            <id>mytomcat</id>
            <username>admin</username>
            <password>test</password>
        </server>
    </servers>
 </settings>

在tomcat-users.xml中输入

<role rolename="manager"/>
<user username="admin" password="test" roles="manager"/>
</tomcat-users>

2 个答案:

答案 0 :(得分:0)

尝试删除已配置的Tomcat管理器URL的“/ html”部分:

    <url>http://localhost:8686/manager</url>

答案 1 :(得分:0)

使用更新的tomcat版本,管理员角色已被拆分为更精细的版本。再次尝试使用具有manager-gui角色的用户?