我正在尝试使用maven
cargo
插件将 Web 应用程序部署到tomcat
服务器中。
但是当我mvn cargo:deploy
在命令提示符下运行命令时出现以下错误。
[信息] 无法部署 [C:\Users\Ramesh\workspace\SimpleSpringMvcExample\target\SimpleSpringMvcExample.war] 失败 - 遇到异常 java.io.FileNotFoundException: C:\Program Files\Apa che Software Foundation\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>
行家设置.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
但不知道出了什么问题?
它工作正常......但突然开始抛出这个错误......在我将 maven-tomcat-plugin 用于其中一个示例 spring 项目之后......
不知道跟这个有没有关系...
请帮我定位问题..
提前致谢。