use of org.apache.maven.archetype.downloader.DownloadNotFoundException in project maven-archetype by apache.
the class DefaultArchetypeArtifactManager method getArchetypeFile.
public File getArchetypeFile(final String groupId, final String artifactId, final String version, ArtifactRepository archetypeRepository, final ArtifactRepository localRepository, final List<ArtifactRepository> repositories, ProjectBuildingRequest buildingRequest) throws UnknownArchetype {
try {
File archetype = getArchetype(groupId, artifactId, version);
if (archetype == null) {
archetype = downloader.download(groupId, artifactId, version, archetypeRepository, localRepository, repositories, buildingRequest);
setArchetype(groupId, artifactId, version, archetype);
}
return archetype;
} catch (DownloadNotFoundException ex) {
throw new UnknownArchetype(ex);
} catch (DownloadException ex) {
throw new UnknownArchetype(ex);
}
}
use of org.apache.maven.archetype.downloader.DownloadNotFoundException in project maven-archetype by apache.
the class DefaultArchetypeArtifactManager method exists.
public boolean exists(String archetypeGroupId, String archetypeArtifactId, String archetypeVersion, ArtifactRepository archetypeRepository, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories, ProjectBuildingRequest buildingRequest) {
try {
File archetype = getArchetype(archetypeGroupId, archetypeArtifactId, archetypeVersion);
if (archetype == null) {
archetype = downloader.download(archetypeGroupId, archetypeArtifactId, archetypeVersion, archetypeRepository, localRepository, remoteRepositories, buildingRequest);
setArchetype(archetypeGroupId, archetypeArtifactId, archetypeVersion, archetype);
}
return archetype.exists();
} catch (DownloadException e) {
getLogger().debug("Archetype " + archetypeGroupId + ":" + archetypeArtifactId + ":" + archetypeVersion + " doesn't exist", e);
return false;
} catch (DownloadNotFoundException e) {
getLogger().debug("Archetype " + archetypeGroupId + ":" + archetypeArtifactId + ":" + archetypeVersion + " doesn't exist", e);
return false;
}
}
Aggregations