// ----------------------------------------------------------------------
// Validate POM generation
// ----------------------------------------------------------------------
ArtifactFactory artifactFactory = (ArtifactFactory) lookup( ArtifactFactory.class.getName() );
Artifact archetypeArtifact = artifactFactory.createArtifact( request.getArchetypeGroupId(), request.getArchetypeArtifactId(),
request.getArchetypeVersion(), Artifact.SCOPE_RUNTIME, "jar" );
StringWriter writer = new StringWriter();
ClassLoader old = Thread.currentThread().getContextClassLoader();