Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MavenBndRepository does not handle multiple snapshot URLs properly #4204

Closed
bjhargrave opened this issue Jul 1, 2020 · 0 comments · Fixed by #4205
Closed

MavenBndRepository does not handle multiple snapshot URLs properly #4204

bjhargrave opened this issue Jul 1, 2020 · 0 comments · Fixed by #4205
Assignees
Milestone

Comments

@bjhargrave
Copy link
Member

bjhargrave commented Jul 1, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant