use of org.jboss.galleon.universe.LatestVersionNotAvailableException in project galleon by wildfly.
the class MavenChannel method getAllBuilds.
@Override
public List<String> getAllBuilds(FeaturePackLocation fpl) throws ProvisioningException {
final MavenArtifact artifact = new MavenArtifact();
artifact.setGroupId(producer.getFeaturePackGroupId());
artifact.setArtifactId(producer.getFeaturePackArtifactId());
artifact.setExtension(MavenArtifact.EXT_ZIP);
artifact.setVersionRange(versionRange);
try {
return producer.getRepo().getAllVersions(artifact, versionIncludePattern, versionExcludePattern);
} catch (MavenLatestVersionNotAvailableException e) {
if (fpl.getFrequency() == null && producer.hasDefaultFrequency()) {
fpl = new FeaturePackLocation(fpl.getUniverse(), fpl.getProducerName(), fpl.getChannelName(), producer.getDefaultFrequency(), null);
}
throw new LatestVersionNotAvailableException(fpl);
} catch (MavenUniverseException e) {
throw e;
}
}
use of org.jboss.galleon.universe.LatestVersionNotAvailableException in project galleon by wildfly.
the class PmSessionCommand method handleCommandExecutionException.
private static Throwable handleCommandExecutionException(Throwable t) {
if (t instanceof CommandExecutionException) {
CommandExecutionException cex = (CommandExecutionException) t;
if (cex.getPmSession() != null) {
// Handle default and named universes
if (cex.getCause() instanceof LatestVersionNotAvailableException) {
LatestVersionNotAvailableException cause = (LatestVersionNotAvailableException) cex.getCause();
FeaturePackLocation fpl = cex.getPmSession().getExposedLocation(null, cause.getLocation());
t = new LatestVersionNotAvailableException(fpl);
}
}
}
return t;
}
use of org.jboss.galleon.universe.LatestVersionNotAvailableException in project galleon by wildfly.
the class MavenChannel method getLatestBuild.
@Override
public String getLatestBuild(FeaturePackLocation fpl) throws ProvisioningException {
final MavenArtifact artifact = new MavenArtifact();
artifact.setGroupId(producer.getFeaturePackGroupId());
artifact.setArtifactId(producer.getFeaturePackArtifactId());
artifact.setExtension(MavenArtifact.EXT_ZIP);
artifact.setVersionRange(versionRange);
try {
return producer.getRepo().getLatestVersion(artifact, getFrequency(fpl), versionIncludePattern, versionExcludePattern);
} catch (MavenLatestVersionNotAvailableException e) {
if (fpl.getFrequency() == null && producer.hasDefaultFrequency()) {
fpl = new FeaturePackLocation(fpl.getUniverse(), fpl.getProducerName(), fpl.getChannelName(), producer.getDefaultFrequency(), null);
}
throw new LatestVersionNotAvailableException(fpl);
} catch (MavenUniverseException e) {
throw e;
}
}
use of org.jboss.galleon.universe.LatestVersionNotAvailableException in project galleon by wildfly.
the class MavenChannel method getLatestBuild.
@Override
public String getLatestBuild(FeaturePackLocation.FPID fpid) throws ProvisioningException {
final MavenArtifact artifact = new MavenArtifact();
artifact.setGroupId(producer.getFeaturePackGroupId());
artifact.setArtifactId(producer.getFeaturePackArtifactId());
artifact.setExtension(MavenArtifact.EXT_ZIP);
artifact.setVersionRange(versionRange);
try {
return producer.getRepo().getLatestVersion(artifact, null, versionIncludePattern, versionExcludePattern);
} catch (MavenLatestVersionNotAvailableException e) {
throw new LatestVersionNotAvailableException(fpid.getLocation());
} catch (MavenUniverseException e) {
throw e;
}
}
use of org.jboss.galleon.universe.LatestVersionNotAvailableException in project galleon by wildfly.
the class CliTestUtils method checkNoVersionAvailable.
public static void checkNoVersionAvailable(CliWrapper cli, FeaturePackLocation toInstall, FeaturePackLocation expected) throws Exception {
Path dir = cli.newDir("install" + System.currentTimeMillis(), false);
FeaturePackLocation loc = null;
try {
cli.execute("install " + toInstall + " --dir=" + dir.toString());
throw new Exception("Install should have failed");
} catch (CommandException ex) {
if (ex.getCause() instanceof CommandExecutionException) {
if (ex.getCause().getCause() != null) {
if (ex.getCause().getCause() instanceof LatestVersionNotAvailableException) {
LatestVersionNotAvailableException lex = (LatestVersionNotAvailableException) ex.getCause().getCause();
loc = lex.getLocation();
}
}
}
}
if (loc == null) {
throw new Exception("Expected exception not found");
}
Assert.assertEquals(loc.toString(), expected, loc);
Assert.assertFalse(dir.toFile().exists());
}
Aggregations