Package org.apache.maven.model

Examples of org.apache.maven.model.Reporting


    }

    private void assembleReportingInheritance( Model child, Model parent )
    {
        // Reports :: aggregate
        Reporting childReporting = child.getReporting();
        Reporting parentReporting = parent.getReporting();

        if ( parentReporting != null )
        {
            if ( childReporting == null )
            {
                childReporting = new Reporting();
                child.setReporting( childReporting );
            }

            childReporting.setExcludeDefaults( parentReporting.isExcludeDefaults() );

            if ( StringUtils.isEmpty( childReporting.getOutputDirectory() ) )
            {
                childReporting.setOutputDirectory( parentReporting.getOutputDirectory() );
            }

            ModelUtils.mergeReportPluginLists( childReporting, parentReporting, true );
        }
    }
View Full Code Here


    {
        Model parent = makeBaseModel( "parent" );

        Model child = makeBaseModel( "child" );

        Reporting parentBuild = new Reporting();
        parentBuild.setExcludeDefaults( false );
        parent.setReporting( parentBuild );

        assembler.assembleModelInheritance( child, parent );

        assertFalse( "Check excludeDefaults is inherited", child.getReporting().isExcludeDefaults() );

        child = makeBaseModel( "child" );

        parentBuild.setExcludeDefaults( true );

        assembler.assembleModelInheritance( child, parent );

        assertTrue( "Check excludeDefaults is inherited", child.getReporting().isExcludeDefaults() );
    }
View Full Code Here

        parentReport.setGroupId( "org.apache.maven.plugins" );
        parentReport.setVersion( "1.0" );

        List parentPlugins = Collections.singletonList( parentReport );

        Reporting parentBuild = new Reporting();
        parentBuild.setPlugins( parentPlugins );

        parent.setReporting( parentBuild );

        assembler.assembleModelInheritance( child, parent );
View Full Code Here

        parentPlugin.setVersion( "1.0" );
        parentPlugin.setInherited( "true" );

        List parentPlugins = Collections.singletonList( parentPlugin );

        Reporting parentBuild = new Reporting();
        parentBuild.setPlugins( parentPlugins );

        parent.setReporting( parentBuild );

        assembler.assembleModelInheritance( child, parent );
View Full Code Here

        parentPlugin.setVersion( "1.0" );
        parentPlugin.setInherited( "false" );

        List parentPlugins = Collections.singletonList( parentPlugin );

        Reporting parentBuild = new Reporting();
        parentBuild.setPlugins( parentPlugins );

        parent.setReporting( parentBuild );

        assembler.assembleModelInheritance( child, parent );
View Full Code Here

        assertReports( new ArrayList(), child );
    }

    private void assertReports( List expectedPlugins, Model child )
    {
        Reporting childBuild = child.getReporting();

        if ( expectedPlugins != null && !expectedPlugins.isEmpty() )
        {
            assertNotNull( childBuild );

            Map childPluginsMap = childBuild.getReportPluginsAsMap();

            if ( childPluginsMap != null )
            {
                assertEquals( expectedPlugins.size(), childPluginsMap.size() );

                for ( Iterator it = expectedPlugins.iterator(); it.hasNext(); )
                {
                    ReportPlugin expectedPlugin = (ReportPlugin) it.next();

                    ReportPlugin childPlugin = (ReportPlugin) childPluginsMap.get( expectedPlugin.getKey() );

                    assertReportsEqual( expectedPlugin, childPlugin );
                }
            }
            else
            {
                fail( "child plugins collection is null, but expectations map is not." );
            }
        }
        else
        {
            assertTrue( childBuild == null || childBuild.getPlugins() == null || childBuild.getPlugins().isEmpty() );
        }
    }
View Full Code Here

            build.setOutputDirectory( alignToBaseDirectory( build.getOutputDirectory(), basedir ) );

            build.setTestOutputDirectory( alignToBaseDirectory( build.getTestOutputDirectory(), basedir ) );
        }

        Reporting reporting = model.getReporting();

        if ( reporting != null )
        {
            reporting.setOutputDirectory( alignToBaseDirectory( reporting.getOutputDirectory(), basedir ) );
        }
    }
View Full Code Here

            build.setOutputDirectory( unalignFromBaseDirectory( build.getOutputDirectory(), basedir ) );

            build.setTestOutputDirectory( unalignFromBaseDirectory( build.getTestOutputDirectory(), basedir ) );
        }

        Reporting reporting = model.getReporting();

        if ( reporting != null )
        {
            reporting.setOutputDirectory( unalignFromBaseDirectory( reporting.getOutputDirectory(), basedir ) );
        }
    }
View Full Code Here

    }

    private void assembleReportingInheritance( Model child, Model parent )
    {
        // Reports :: aggregate
        Reporting childReporting = child.getReporting();
        Reporting parentReporting = parent.getReporting();

        if ( parentReporting != null )
        {
            if ( childReporting == null )
            {
                childReporting = new Reporting();
                child.setReporting( childReporting );
            }

            childReporting.setExcludeDefaults( parentReporting.isExcludeDefaults() );

            if ( StringUtils.isEmpty( childReporting.getOutputDirectory() ) )
            {
                childReporting.setOutputDirectory( parentReporting.getOutputDirectory() );
            }

            mergeReportPluginLists( childReporting, parentReporting, true );
        }
    }
View Full Code Here

    }

    protected void mergeModelBase_Reporting( ModelBase target, ModelBase source, boolean sourceDominant,
                                             Map<Object, Object> context )
    {
        Reporting src = source.getReporting();
        if ( src != null )
        {
            Reporting tgt = target.getReporting();
            if ( tgt == null )
            {
                tgt = new Reporting();
                target.setReporting( tgt );
            }
            mergeReporting( tgt, src, sourceDominant, context );
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.model.Reporting

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.