ArchivaRepositoryMetadata m = new ArchivaRepositoryMetadata();
m.setGroupId( actualMetadata.getGroupId() );
for ( String pluginId : expectedPlugins )
{
Plugin p = new Plugin();
p.setPrefix( pluginId );
p.setArtifactId( pluginId + "-maven-plugin" );
p.setName( "The " + pluginId + " Plugin" );
m.getPlugins().add( p );
}
RepositoryMetadataWriter.write( m, expectedMetadataXml );