mirror of
https://github.com/apache/maven.git
synced 2025-02-06 18:18:48 +00:00
fix bug I introduced
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@165090 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
bd286bfc46
commit
05ebfd3b91
@ -312,64 +312,68 @@ private void assembleBuildInheritance( Model child, Model parent )
|
||||
Build childBuild = child.getBuild();
|
||||
Build parentBuild = parent.getBuild();
|
||||
|
||||
if ( childBuild == null )
|
||||
if ( parentBuild != null )
|
||||
{
|
||||
child.setBuild( new Build() );
|
||||
if ( childBuild == null )
|
||||
{
|
||||
childBuild = new Build();
|
||||
child.setBuild( childBuild );
|
||||
}
|
||||
// The build has been set but we want to step in here and fill in
|
||||
// values
|
||||
// that have not been set by the child.
|
||||
|
||||
if ( childBuild.getDirectory() == null )
|
||||
{
|
||||
childBuild.setDirectory( parentBuild.getDirectory() );
|
||||
}
|
||||
|
||||
if ( childBuild.getSourceDirectory() == null )
|
||||
{
|
||||
childBuild.setSourceDirectory( parentBuild.getSourceDirectory() );
|
||||
}
|
||||
|
||||
if ( childBuild.getScriptSourceDirectory() == null )
|
||||
{
|
||||
childBuild.setScriptSourceDirectory( parentBuild.getScriptSourceDirectory() );
|
||||
}
|
||||
|
||||
if ( childBuild.getTestSourceDirectory() == null )
|
||||
{
|
||||
childBuild.setTestSourceDirectory( parentBuild.getTestSourceDirectory() );
|
||||
}
|
||||
|
||||
if ( childBuild.getOutputDirectory() == null )
|
||||
{
|
||||
childBuild.setOutputDirectory( parentBuild.getOutputDirectory() );
|
||||
}
|
||||
|
||||
if ( childBuild.getTestOutputDirectory() == null )
|
||||
{
|
||||
childBuild.setTestOutputDirectory( parentBuild.getTestOutputDirectory() );
|
||||
}
|
||||
|
||||
if ( childBuild.getFinalName() == null )
|
||||
{
|
||||
childBuild.setFinalName( parentBuild.getFinalName() );
|
||||
}
|
||||
|
||||
List resources = childBuild.getResources();
|
||||
if ( resources == null || resources.isEmpty() )
|
||||
{
|
||||
childBuild.setResources( parentBuild.getResources() );
|
||||
}
|
||||
|
||||
resources = childBuild.getTestResources();
|
||||
if ( resources == null || resources.isEmpty() )
|
||||
{
|
||||
childBuild.setTestResources( parentBuild.getTestResources() );
|
||||
}
|
||||
|
||||
// Plugins are not aggregated, but management is
|
||||
|
||||
assemblePluginManagementInheritance( childBuild, parentBuild );
|
||||
}
|
||||
// The build has been set but we want to step in here and fill in
|
||||
// values
|
||||
// that have not been set by the child.
|
||||
|
||||
if ( childBuild.getDirectory() == null )
|
||||
{
|
||||
childBuild.setDirectory( parentBuild.getDirectory() );
|
||||
}
|
||||
|
||||
if ( childBuild.getSourceDirectory() == null )
|
||||
{
|
||||
childBuild.setSourceDirectory( parentBuild.getSourceDirectory() );
|
||||
}
|
||||
|
||||
if ( childBuild.getScriptSourceDirectory() == null )
|
||||
{
|
||||
childBuild.setScriptSourceDirectory( parentBuild.getScriptSourceDirectory() );
|
||||
}
|
||||
|
||||
if ( childBuild.getTestSourceDirectory() == null )
|
||||
{
|
||||
childBuild.setTestSourceDirectory( parentBuild.getTestSourceDirectory() );
|
||||
}
|
||||
|
||||
if ( childBuild.getOutputDirectory() == null )
|
||||
{
|
||||
childBuild.setOutputDirectory( parentBuild.getOutputDirectory() );
|
||||
}
|
||||
|
||||
if ( childBuild.getTestOutputDirectory() == null )
|
||||
{
|
||||
childBuild.setTestOutputDirectory( parentBuild.getTestOutputDirectory() );
|
||||
}
|
||||
|
||||
if ( childBuild.getFinalName() == null )
|
||||
{
|
||||
childBuild.setFinalName( parentBuild.getFinalName() );
|
||||
}
|
||||
|
||||
List resources = childBuild.getResources();
|
||||
if ( resources == null || resources.isEmpty() )
|
||||
{
|
||||
childBuild.setResources( parentBuild.getResources() );
|
||||
}
|
||||
|
||||
resources = childBuild.getTestResources();
|
||||
if ( resources == null || resources.isEmpty() )
|
||||
{
|
||||
childBuild.setTestResources( parentBuild.getTestResources() );
|
||||
}
|
||||
|
||||
// Plugins are not aggregated, but management is
|
||||
|
||||
assemblePluginManagementInheritance( childBuild, parentBuild );
|
||||
}
|
||||
|
||||
private void assembleScmInheritance( Model child, Model parent )
|
||||
|
Loading…
x
Reference in New Issue
Block a user