【发布时间】:2014-12-04 19:42:13
【问题描述】:
我的项目有一个 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>ProjectMav</groupId>
<artifactId>ProjectMav</artifactId>
<version>1.0</version>
<distributionManagement>
<repository>
<id>man-release</id>
<name>mav release repo</name>
<url>http://xxxxxx.net/repositories/mav-release/</url>
</repository>
<snapshotRepository>
<id>mav-snapshots</id>
<name>mav snapshots repo</name>
<url>http://xxxxxx.net/repositories/mav-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
执行“mvn deploy”后,我确实浏览了远程存储库,并且在那里看到了项目
我有另一个项目依赖于上面提到的“ProjectMav”,它的 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>mavtest</groupId>
<artifactId>mavtest-suite</artifactId>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>ProjectMav</groupId>
<artifactId>ProjectMav</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>mav-release</id>
<name>mav release repo</name>
<url>http://xxxxxx.net/repositories/mav-release/</url>
</repository>
</repositories>
<build>
<testSourceDirectory>src/com/mav/</testSourceDirectory>
<resources>
<resource>
<directory>/resources</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
现在,如果我执行 Maven>更新项目,它不会从 Eclipse 获取我的“ProjectMav”的最新版本到我的本地存储库。
但如果我清除本地 repo 中的所有文件并进行 maven 更新,它会得到我的项目
知道发生了什么吗?
【问题讨论】:
标签: eclipse maven maven-2 maven-3 maven-plugin