我为我的项目配置了以下 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- The Basics -->
<groupId>fcrt.fcBase.MyProject</groupId>
<artifactId>MyProject</artifactId>
<version>1.0</version>
<name>My Project</name>
<packaging>war</packaging>
<!-- Build Settings -->
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.0</version>
<configuration>
<webXml>web.xml</webXml>
<webResources>
<resource>
<filtering>true</filtering>
<directory>${basedir}/WebContent/WEB-INF</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
</project>
但是,由于我使用的是 maven-2.0.5 版本,因此由于兼容性问题,我将不得不使用 maven-war-plugin-2.0.jar 而不是 maven-war-plugin-2.1.1.jar。在创建战争时,我收到以下错误:
[INFO] 执行目标 'org.apache.maven.plu gins:maven-war-plugin:2.0:war' 的插件管理器内部错误:找不到 mojo 'org.apache.maven.plugin s:maven-war -plugin:2.0:war' 在插件'org.apache.maven.plugins:maven-war-pl ugin'
如果 Maven 无法从 apache 站点下载它,有什么方法可以让 Maven 在我的本地(因为我在本地有它)上查找 jar?另请确认我拥有的 pom.xml 是否正确?