ArchetypeManager archetype = (ArchetypeManager) lookup( ArchetypeManager.ROLE );
// In the embedder the localRepository will be retrieved from the embedder itself and users won't
// have to go through this muck.
ArchetypeRegistryManager registryManager = (ArchetypeRegistryManager) lookup( ArchetypeRegistryManager.ROLE );
ArtifactRepository localRepository = registryManager.createRepository(
new File( getBasedir(), "target/test-classes/repositories/local" )
.toURI().toURL().toExternalForm(), "local-repo" );
ArchetypeCatalog catalog = archetype.getLocalCatalog(
new File( getBasedir(), "target/test-classes/repositories/central" ).getAbsolutePath()