diff --git a/core/src/main/java/org/wildfly/channel/ChannelImpl.java b/core/src/main/java/org/wildfly/channel/ChannelImpl.java index ffa646c0..a4d508b5 100644 --- a/core/src/main/java/org/wildfly/channel/ChannelImpl.java +++ b/core/src/main/java/org/wildfly/channel/ChannelImpl.java @@ -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; @@ -38,6 +39,8 @@ */ class ChannelImpl implements AutoCloseable { + private static final Logger LOG = Logger.getLogger(ChannelImpl.class); + private Channel channelDefinition; private List requiredChannels = Collections.emptyList(); @@ -230,11 +233,23 @@ Optional 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()); + return Optional.empty(); + } 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()); + return Optional.empty(); + } default: return Optional.empty(); }