-
-
Notifications
You must be signed in to change notification settings - Fork 300
Description
In the OSGi build, I configured the snapshotUrl configuration property with 2 URLs. So an artifact can be at one of the URL and probably not both. However, if the artifact is not at the first URL, the MavenRemoteRepository lodges
an error which fails the build.
MavenRepository looks through all the MavenBackingRepositories (one per URL) for the snapshot archive:
bnd/biz.aQute.repository/src/aQute/maven/provider/MavenRepository.java
Lines 204 to 215 in e310406
| public Archive resolveSnapshot(Archive archive) throws Exception { | |
| if (archive.isResolved()) | |
| return archive; | |
| for (MavenBackingRepository mbr : snapshot) { | |
| MavenVersion version = mbr.getVersion(archive.revision); | |
| if (version != null) | |
| return archive.resolveSnapshot(version); | |
| } | |
| return null; | |
| } |
But the MavenBackingRepository adds an error if it does not contain the archive:
bnd/biz.aQute.repository/src/aQute/maven/provider/MavenBackingRepository.java
Lines 166 to 171 in e310406
| public MavenVersion getVersion(Revision revision) throws Exception { | |
| Optional<RevisionMetadata> metadata = getMetadata(revision); | |
| if (!metadata.isPresent()) { | |
| reporter.error("No metadata for revision %s", revision); | |
| return null; | |
| } |
Any such error must only be raised after all the MavenBackingRepositories are queried.