projectBuildingHelper.createArtifactRepositories( model.getPluginRepositories(), pluginRepositories,
projectBuildingRequest );
}
catch ( Exception e )
{
event.getProblems().add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE )
.setMessage( "Invalid plugin repository: " + e.getMessage() )
.setException( e ) );
}
project.setPluginArtifactRepositories( pluginRepositories );
if ( event.getRequest().isProcessPlugins() )
{
try
{
ProjectRealmCache.CacheRecord record =
projectBuildingHelper.createProjectRealm( project, model, projectBuildingRequest );
project.setClassRealm( record.realm );
project.setExtensionDependencyFilter( record.extensionArtifactFilter );
}
catch ( PluginResolutionException e )
{
event.getProblems().add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE )
.setMessage( "Unresolveable build extension: " + e.getMessage() )
.setException( e ) );
}
catch ( PluginVersionResolutionException e )
{
event.getProblems().add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE )
.setMessage( "Unresolveable build extension: " + e.getMessage() )
.setException( e ) );
}
projectBuildingHelper.selectProjectRealm( project );
}
// build the regular repos after extensions are loaded to allow for custom layouts
try
{
remoteRepositories =
projectBuildingHelper.createArtifactRepositories( model.getRepositories(), remoteRepositories,
projectBuildingRequest );
}
catch ( Exception e )
{
event.getProblems().add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE )
.setMessage( "Invalid artifact repository: " + e.getMessage() )
.setException( e ) );
}
project.setRemoteArtifactRepositories( remoteRepositories );
}