我是Maven的新手,我看过很多与我相似的帖子,但我无法解决问题。 我有一个Maven项目,其中Maven依赖于其他Maven项目。 但是,在项目中执行Maven Build时,目标是' package'我得到以下痕迹。
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building docsvcs 1
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.idiginfo.docsvc:models:jar:1 is missing, no dependency information available
[WARNING] The POM for org.idiginfo.docsvc:apisvc:jar:1 is missing, no dependency information available
[WARNING] The POM for org.idiginfo.docsvc:repositories:jar:1 is missing, no dependency information available
[WARNING] The POM for org.idiginfo.docsvc:views:jar:1 is missing, no dependency information available
[WARNING] The POM for org.idiginfo.docsvc:wok_v3:jar:1 is missing, no dependency information available
[WARNING] The POM for org.idiginfo.docsvc:harvest:jar:1 is missing, no dependency information available
[WARNING] The POM for org.idiginfo.docsvc:controllers:jar:1 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.270s
[INFO] Finished at: Mon Mar 03 14:23:34 EST 2014
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project docsvcs: Could not resolve dependencies for project org.idiginfo.docsvc:docsvcs:war:1: The following artifacts could not be resolved: org.idiginfo.docsvc:models:jar:1, org.idiginfo.docsvc:apisvc:jar:1, org.idiginfo.docsvc:repositories:jar:1, org.idiginfo.docsvc:views:jar:1, org.idiginfo.docsvc:wok_v3:jar:1, org.idiginfo.docsvc:harvest:jar:1, org.idiginfo.docsvc:controllers:jar:1: Failure to find org.idiginfo.docsvc:models:jar:1 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
我执行了Maven clean,然后是Maven Update Project。 这是我的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>
<groupId>org.idiginfo.docsvc</groupId>
<artifactId>docsvcs</artifactId>
<packaging>war</packaging>
<parent>
<groupId>org.idiginfo.docservice</groupId>
<artifactId>service</artifactId>
<version>1</version>
<relativePath>../service</relativePath>
</parent>
<build>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<warName>docsvcs</warName>
<warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
<dependentWarExcludes>WEB-INF/web.xml,**/**.class</dependentWarExcludes>
<webResources>
<resource>
<!-- change if necessary -->
<directory>src/main/webapp/WEB-INF</directory>
<filtering>true</filtering>
<targetPath>WEB-INF</targetPath>
</resource>
<resource>
<directory>../repositories/src/META-INF</directory>
<!-- override the destination directory for this resource -->
<targetPath>WEB-INF/classes/META-INF</targetPath>
<includes>
<include>persistence.xml</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.idiginfo.docsvc</groupId>
<artifactId>models</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.idiginfo.docsvc</groupId>
<artifactId>apisvc</artifactId>
<version>1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.idiginfo.docsvc</groupId>
<artifactId>repositories</artifactId>
<version>1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.idiginfo.docsvc</groupId>
<artifactId>views</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.idiginfo.docsvc</groupId>
<artifactId>wok_v3</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.idiginfo.docsvc</groupId>
<artifactId>harvest</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.idiginfo.docsvc</groupId>
<artifactId>controllers</artifactId>
<version>1</version>
</dependency>
</dependencies>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Central Repository</name>
<url>http://repo.maven.apache.org/maven2</url>
</repository>
</repositories>
</project>