在tomcat maven上部署war时获取HTTP状态404

时间:2013-11-08 07:23:14

标签: maven-tomcat-plugin

我正在构建一个开源android moteve视频流项目的war文件,并使用mvn tomcat:deploy命令从我的终端部署到tomcat,并在终端上显示消息构建成功,但是在进行链接时显示HTTP状态 - 404,请求的资源(/ motevwebapp /)不可用。我陷入了这个错误,无法解决它。请有人帮助我。提前谢谢。

这是我的pom.xml

   <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>
 <parent>
    <groupId>com.moteve</groupId>
    <artifactId>moteve-server-parent</artifactId>
    <version>${moteve-server-parent-version}</version>
    <relativePath>../moteve-server-parent/pom.xml</relativePath>
  </parent>
 <groupId>com.moteve</groupId>
  <artifactId>moteve-server-webapp</artifactId>
  <packaging>war</packaging>
  <version>${moteve-server-webapp-version}</version>
  <name>Moteve Web Application</name>
  <url>http://moteve.com</url>
 <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.moteve</groupId>
      <artifactId>moteve-server-core</artifactId>
      <version>${moteve-server-core-version}</version>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>${log4j-version}</version>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>${servlet-api-version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-webmvc</artifactId>
      <version>${spring-webmvc-version}</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit-version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <finalName>moteve-server-webapp</finalName>
<plugins>
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>tomcat-maven-plugin</artifactId>
    <configuration>
            <server>myserver</server>
            <username>admin</username>
            <password>admin</password>
 <url>http://localhost:8080/manager/text</url>
<path>/motevwebapp</path> 

    </configuration>
</plugin>
</plugins>
  </build>
</project>

1 个答案:

答案 0 :(得分:0)

请使用Apache的最新版本(codehaus代码已移至Apache)。

http://tomcat.apache.org/maven-plugin.html