Skip to content

MavenBndRepository does not handle multiple snapshot URLs properly #4204

@bjhargrave

Description

@bjhargrave

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:

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:

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions