我正在尝试使用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
<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
<?xml version='1.0' encoding='cp1252'?>
<tomcat-users>
<user name="admin" password="admin" roles="admin,manager" />
</tomcat-users>maven settings.xml
<?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作为一个春季项目的示例
我不知道这和这事有什么关系.
请帮我找出问题所在。
提前谢谢。
发布于 2010-09-30 14:55:03
从错误中可以看出,权限存在问题- maven似乎没有权限将.war文件放置在tomcat的webapp文件夹中。
你在Vista/Windows 7上打开UAC吗?
https://stackoverflow.com/questions/3831752
复制相似问题