首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >未能使用maven cargo在tomcat中部署webapp

未能使用maven cargo在tomcat中部署webapp
EN

Stack Overflow用户
提问于 2010-09-30 14:49:47
回答 1查看 1.8K关注 0票数 1

我正在尝试使用maven cargo插件将一个into应用程序部署到tomcat服务器上。

但是,当我在命令提示符下运行命令mvn cargo:deploy时,会得到以下错误。

C:\Users\Ramesh\workspace\SimpleSpringMvcExample\target \SimpleSpringMvcExample.war失败-遇到异常java.io.FileNotFoundException: C:\Program \Apa\Tomcat 6.0\webapps\SimpleSpringMvcExample.war (访问被拒绝)

pom.xml

代码语言:javascript
复制
<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.SimpleSpringMvcExample</groupId>
    <artifactId>SimpleSpringMvcExample</artifactId>
    <packaging>war</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <name>SimpleSpringMvcExample Maven Webapp</name>
    <url>http://maven.apache.org</url>

    .....

    <build>
        <finalName>SimpleSpringMvcExample</finalName>
        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.0.2</version>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
            <plugin>

                <groupId>org.codehaus.cargo</groupId>
                <artifactId>cargo-maven2-plugin</artifactId>
                <version>1.0</version>
                <configuration>
                    <container>
                        <containerId>tomcat6x</containerId>
                        <type>remote</type>
                    </container>
                    <configuration>
                        <type>runtime</type>
                        <properties>
                            <cargo.tomcat.manager.url>http://localhost:8080/manager</cargo.tomcat.manager.url>
                            <cargo.remote.username>admin</cargo.remote.username>
                            <cargo.remote.password>admin</cargo.remote.password>
                        </properties>
                    </configuration>
                    <deployer>
                        <type>remote</type>
                        <deployables>
                            <deployable>
                                <groupId>com.SimpleSpringMvcExample</groupId>
                                <artifactId>SimpleSpringMvcExample</artifactId>
                                <type>war</type>
                            </deployable>
                        </deployables>
                    </deployer>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>tomcat-maven-plugin</artifactId>
                <version>1.0-beta-1</version>
            </plugin>
        </plugins>
    </build>
</project>

tomcat-users.xml

代码语言:javascript
复制
<?xml version='1.0' encoding='cp1252'?>

<tomcat-users>
<user name="admin" password="admin" roles="admin,manager" />
</tomcat-users>

maven settings.xml

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <pluginGroups>
  </pluginGroups>
  <proxies>
  </proxies>
  <servers>
  </servers>
  <mirrors>
  </mirrors>
  <profiles>
  </profiles>
</settings>

我想我在pom.xml中给出了tomcat管理员的正确id和密码,但不知道哪里出了问题?

,它正在工作,fine..but突然开始抛出这个error...after,我用maven-tomcat-plugin作为一个春季项目的示例

我不知道这和这事有什么关系.

请帮我找出问题所在。

提前谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-09-30 14:55:03

从错误中可以看出,权限存在问题- maven似乎没有权限将.war文件放置在tomcat的webapp文件夹中。

你在Vista/Windows 7上打开UAC吗?

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3831752

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档