Examples of Reporting


Examples of org.apache.maven.model.Reporting

    implements ReportingConverter
{

    public void convertReporting( Model model, ModelBuildingRequest request, ModelProblemCollector problems )
    {
        Reporting reporting = model.getReporting();

        if ( reporting == null )
        {
            return;
        }

        Build build = model.getBuild();

        if ( build == null )
        {
            build = new Build();
            model.setBuild( build );
        }

        Plugin sitePlugin = findSitePlugin( build );

        if ( sitePlugin == null )
        {
            sitePlugin = new Plugin();
            sitePlugin.setArtifactId( "maven-site-plugin" );
            PluginManagement pluginManagement = build.getPluginManagement();
            if ( pluginManagement == null )
            {
                pluginManagement = new PluginManagement();
                build.setPluginManagement( pluginManagement );
            }
            pluginManagement.addPlugin( sitePlugin );
        }

        Xpp3Dom configuration = (Xpp3Dom) sitePlugin.getConfiguration();

        if ( configuration == null )
        {
            configuration = new Xpp3Dom( "configuration" );
            sitePlugin.setConfiguration( configuration );
        }

        Xpp3Dom reportPlugins = configuration.getChild( "reportPlugins" );

        if ( reportPlugins != null )
        {
            // new-style report configuration already present, assume user handled entire conversion
            return;
        }

        if ( configuration.getChild( "outputDirectory" ) == null )
        {
            addDom( configuration, "outputDirectory", reporting.getOutputDirectory() );
        }

        reportPlugins = new Xpp3Dom( "reportPlugins" );
        configuration.addChild( reportPlugins );

        boolean hasMavenProjectInfoReportsPlugin = false;

        /* waiting for MSITE-484 before deprecating <reporting> section
        if ( !reporting.getPlugins().isEmpty()
            && request.getValidationLevel() >= ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_3_1 )
        {

            problems.add( new ModelProblemCollectorRequest( Severity.WARNING, Version.V31 )
                    .setMessage( "The <reporting> section is deprecated, please move the reports to the <configuration> section of the new Maven Site Plugin." )
                    .setLocation( reporting.getLocation( "" ) ) );
        }*/

        for ( ReportPlugin plugin : reporting.getPlugins() )
        {
            Xpp3Dom reportPlugin = convert( plugin );
            reportPlugins.addChild( reportPlugin );

            if ( !reporting.isExcludeDefaults() && !hasMavenProjectInfoReportsPlugin
                && "org.apache.maven.plugins".equals( plugin.getGroupId() )
                && "maven-project-info-reports-plugin".equals( plugin.getArtifactId() ) )
            {
                hasMavenProjectInfoReportsPlugin = true;
            }
        }

        if ( !reporting.isExcludeDefaults() && !hasMavenProjectInfoReportsPlugin )
        {
            Xpp3Dom dom = new Xpp3Dom( "reportPlugin" );

            addDom( dom, "groupId", "org.apache.maven.plugins" );
            addDom( dom, "artifactId", "maven-project-info-reports-plugin" );
View Full Code Here

Examples of org.apache.maven.model.Reporting

        return scm;
    }

    private Reporting translateReports( List v3Reports )
    {
        Reporting reports = null;
        if ( v3Reports != null && !v3Reports.isEmpty() )
        {
            reports = new Reporting();
            for ( Iterator it = v3Reports.iterator(); it.hasNext(); )
            {
                String reportName = (String) it.next();

                Pattern pluginNamePattern = Pattern.compile( "maven-(.+)-plugin" );
                Matcher matcher = pluginNamePattern.matcher( reportName );

                if ( !matcher.matches() )
                {
                    warnings.add(
                        "Non-standard report: \'" + reportName + "\'. Skipping this one." );
                }
                else
                {
                    ReportPlugin reportPlugin = new ReportPlugin();

                    reportPlugin.setGroupId( findReportPluginGroupId( reportName ) );

                    reportPlugin.setArtifactId( reportName );

                    StringBuffer info = new StringBuffer();

                    info.append( "Using some derived information for report: \'" ).append( reportName )
                        .append( "\'.\n" )
                        .append( "\to groupId: \'" ).append( reportPlugin.getGroupId() ).append( "\'\n" )
                        .append( "\to artifactId: \'" ).append( reportName ).append( "\'\n" )
                        .append( "\to goal: \'report\'\n" )
                        .append( "\n" )
                        .append( "These values were extracted using the v3 report naming convention," )
                        .append( " but may be wrong." );

                    warnings.add( info.toString() );

                    reports.addPlugin( reportPlugin );
                }
            }
        }

        return reports;
View Full Code Here

Examples of org.apache.maven.model.Reporting

                if ( addPlugin )
                {
                    if ( v4Model.getReporting() == null )
                    {
                        v4Model.setReporting( new Reporting() );
                    }
                    v4Model.getReporting().addPlugin( plugin );
                    sendInfoMessage( "Adding report " + plugin.getGroupId() + ":" + plugin.getArtifactId() );
                    fireAddReportEvent( plugin );
                }
View Full Code Here

Examples of org.apache.maven.model.Reporting

     * @return Reporting
     */
    private Reporting parseReporting( String tagName, XmlPullParser parser, boolean strict )
        throws IOException, XmlPullParserException
    {
        Reporting reporting = new Reporting();
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( checkFieldWithDuplicate( parser, "excludeDefaults", null, parsed ) )
            {
                reporting.setExcludeDefaults( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "outputDirectory", null, parsed ) )
            {
                reporting.setOutputDirectory( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "plugins", null, parsed ) )
            {
                java.util.List plugins = new java.util.ArrayList/*<ReportPlugin>*/();
                reporting.setPlugins( plugins );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( parser.getName().equals( "plugin" ) )
                    {
                        plugins.add( parseReportPlugin( "plugin", parser, strict ) );
View Full Code Here

Examples of org.apache.maven.model.Reporting

        }

        // MLINKCHECK-1
        if ( clone.getOriginalModel().getReporting() == null )
        {
            clone.getOriginalModel().setReporting( new Reporting() );
        }

        clone.getOriginalModel().getReporting().setOutputDirectory( tmpReportingOutputDirectory.getAbsolutePath() );
        List profileIds = getActiveProfileIds( clone );
View Full Code Here

Examples of org.apache.maven.model.Reporting

    /**
     * {@inheritDoc}
     */
    public List getReportPlugins()
    {
        Reporting reporting = new Reporting();

        ReportPlugin reportPlugin = new ReportPlugin();
        reportPlugin.setGroupId( "org.apache.maven.plugins" );
        reportPlugin.setArtifactId( "maven-jxr-plugin" );
        reportPlugin.setVersion( "2.0-SNAPSHOT" );
        reporting.addPlugin( reportPlugin );

        Model model = new Model();

        model.setReporting( reporting );

        return reporting.getPlugins();
    }
View Full Code Here

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() );
            }

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

Examples of org.apache.maven.model.Reporting

            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

Examples of org.apache.maven.model.Reporting

            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

Examples of org.apache.maven.model.Reporting

                validate20RawResources( problems, build.getResources(), "build.resources.resource", request );

                validate20RawResources( problems, build.getTestResources(), "build.testResources.testResource", request );
            }

            Reporting reporting = model.getReporting();
            if ( reporting != null )
            {
                for ( ReportPlugin p : reporting.getPlugins() )
                {
                    validateStringNotEmpty( "reporting.plugins.plugin.artifactId", problems, Severity.ERROR, Version.V20,
                                            p.getArtifactId(), p );

                    validateStringNotEmpty( "reporting.plugins.plugin.groupId", problems, Severity.ERROR, Version.V20,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.