model.setProperties( props );
}
private void injectBuild( Profile profile, Model model )
{
BuildBase profileBuild = profile.getBuild();
Build modelBuild = model.getBuild();
// if the parent build is null, obviously we cannot inherit from it...
if ( profileBuild != null )
{
if ( modelBuild == null )
{
modelBuild = new Build();
model.setBuild( modelBuild );
}
if ( profileBuild.getDirectory() != null )
{
modelBuild.setDirectory( profileBuild.getDirectory() );
}
if ( profileBuild.getDefaultGoal() != null )
{
modelBuild.setDefaultGoal( profileBuild.getDefaultGoal() );
}
if ( profileBuild.getFinalName() != null )
{
modelBuild.setFinalName( profileBuild.getFinalName() );
}
ModelUtils.mergeFilterLists( modelBuild.getFilters(), profileBuild.getFilters() );
ModelUtils.mergeResourceLists( modelBuild.getResources(), profileBuild.getResources() );
ModelUtils.mergeResourceLists( modelBuild.getTestResources(), profileBuild.getTestResources() );
injectPlugins( profileBuild, modelBuild );
// Plugin management :: aggregate
PluginManagement profilePM = profileBuild.getPluginManagement();
PluginManagement modelPM = modelBuild.getPluginManagement();
if ( modelPM == null )
{
modelBuild.setPluginManagement( profilePM );