Skip to content

Commit

Permalink
Metadata resolution failure in one channel should not fail installation
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasHofman committed Mar 18, 2024
1 parent d8642a5 commit af66560
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions core/src/main/java/org/wildfly/channel/ChannelImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.Set;
import java.util.stream.Collectors;

import org.jboss.logging.Logger;
import org.wildfly.channel.spi.MavenVersionsResolver;
import org.wildfly.channel.version.VersionMatcher;

Expand All @@ -38,6 +39,8 @@
*/
class ChannelImpl implements AutoCloseable {

private static final Logger LOG = Logger.getLogger(ChannelImpl.class);

private Channel channelDefinition;

private List<ChannelImpl> requiredChannels = Collections.emptyList();
Expand Down Expand Up @@ -230,11 +233,21 @@ Optional<ResolveLatestVersionResult> resolveLatestVersion(String groupId, String
return Optional.empty();
}
case MAVEN_LATEST:
String latestMetadataVersion = resolver.getMetadataLatestVersion(groupId, artifactId);
return Optional.of(new ResolveLatestVersionResult(latestMetadataVersion, this));
try {
String latestMetadataVersion = resolver.getMetadataLatestVersion(groupId, artifactId);
return Optional.of(new ResolveLatestVersionResult(latestMetadataVersion, this));
} catch (NoStreamFoundException e) {
LOG.debugf(e, "Metadata resolution for %s:%s failed in channel %s",
groupId, artifactId, this.getChannelDefinition().getName());
}
case MAVEN_RELEASE:
String releaseMetadataVersion = resolver.getMetadataReleaseVersion(groupId, artifactId);
return Optional.of(new ResolveLatestVersionResult(releaseMetadataVersion, this));
try {
String releaseMetadataVersion = resolver.getMetadataReleaseVersion(groupId, artifactId);
return Optional.of(new ResolveLatestVersionResult(releaseMetadataVersion, this));
} catch (NoStreamFoundException e) {
LOG.debugf(e, "Metadata resolution for %s:%s failed in channel %s",
groupId, artifactId, this.getChannelDefinition().getName());
}
default:
return Optional.empty();
}
Expand Down

0 comments on commit af66560

Please sign in to comment.