Hi Maven Gurus,

Looks like Maven 3 always try to download the transitive dependencies even though it's available in the local repo.

In the pom, I have the following dependency defined:
<dependency>
<groupId>org.glassfish.fighterfish</groupId>
<artifactId>osgi-web-container</artifactId>
<version>1.0.2</version>
</dependency>
This artifact is available in Maven central. However, the transitive dependency "org.eclipse.persistence:javax.persistence" is not available in Maven central. So I added the EclipseLink repo in settings.xml:
<profile>
<id>eclipse-repo</id>
<repositories>
<repository>
<id>eclipselink.repository</id>
<name>EclipseLink Repo</name>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>http://download.eclipse.org/rt/eclipselink/maven.repo/</url>
<layout>default</layout>
</repository>
</repositories>
</profile>
The build succeeded when I compiled with "-Peclipse-repo" profile since it was able to download the javax.persistence artifact from EclipseLink Maven repo. The local maven repo is now populated with javax.persistence artifact. The second time I compiled w/o "-Peclipse-repo" profile, it failed with the following message:

[ERROR] Failed to execute goal on project test.maven3: Could not resolve dependencies for project test:test.maven3:jar:1.0-SNAPSHOT: Failure to find org.eclipse.persistence:javax.persistence:jar:2.0.3 in http://repo1.maven.org/maven2/ was cached in the local repository, resolution will not be reattempted until the update interval of maven-central has elapsed or updates are forced -> [Help 1]

Why is Maven trying to download the artifact if it's available in the local maven repo?
This works in Maven 2 but not Maven 3.  Is this a bug in Maven 3?

Thanks,
Jane

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to