{
final IteratorSearchResponse infos = listArchetypes(request, ctx);
try {
final ArchetypeCatalog catalog = new ArchetypeCatalog();
Archetype archetype = null;
// fill it in
for (ArtifactInfo info : infos) {
archetype = new Archetype();
archetype.setGroupId(info.groupId);
archetype.setArtifactId(info.artifactId);
archetype.setVersion(info.version);
archetype.setDescription(info.description);
if (StringUtils.isNotEmpty(request.getRepositoryUrl())) {
archetype.setRepository(request.getRepositoryUrl());
}
catalog.addArchetype(archetype);
}
return catalog;
}