List<String> errors = new ArrayList<String>();
List<String> warnings = new ArrayList<String>();
for ( Archetype a : ac.getArchetypes() )
{
Archetype ar = new Archetype();
ar.setGroupId( a.getGroupId() );
ar.setArtifactId( a.getArtifactId() );
ar.setVersion( "RELEASE" );
ar.setDescription( a.getDescription() );
ar.setGoals( a.getGoals() );
ar.setProperties( a.getProperties() );
ar.setRepository( a.getRepository() );
if ( ar.getRepository() == null )
{
ar.setRepository( CENTRAL );
}
ArchetypeGenerationResult releaseGenerationResult = testArchetype( count, ar );
if ( releaseGenerationResult.getCause() != null )
{
// RELEASE version failed: try with the version specified in the Wiki
ar.setVersion( a.getVersion() );
ArchetypeGenerationResult generationResult = testArchetype( count, ar );
if ( generationResult.getCause() == null )
{
if ( !( ar.getVersion().indexOf( "SNAPSHOT" ) > 0 )
&& !( ar.getVersion().indexOf( "snapshot" ) > 0 ) )
{
validArchetypes.add( ar );
warnings.add( "#" + count + ' ' + ar + ": error for RELEASE - " + releaseGenerationResult.getCause().getMessage() );
}
}
else
{
errors.add( "#" + count + ' ' + ar + ' ' + generationResult.getCause().getMessage() );
}
}
else
{
validArchetypes.add( ar );
if ( !"RELEASE".equals( a.getVersion() ) )
{
warnings.add( "#" + count + ' ' + ar + ": Wiki page mentions " + a.getVersion() +", should be empty since RELEASE is ok." );
}
}
if ( CENTRAL.equals( ar.getRepository() ) )
{
ar.setRepository( null );
}
count++;
System.out.println( "\n\n" );