Package org.apache.maven.model

Examples of org.apache.maven.model.ReportPlugin


        Collection plugin = project.getReportPlugins();
        if ( plugin != null )
        {
            for ( Iterator iter = plugin.iterator(); iter.hasNext(); )
            {
                ReportPlugin reportPlugin = (ReportPlugin) iter.next();
                if ( "maven-javadoc-plugin".equals( reportPlugin.getArtifactId() ) )
                {
                    break;
                }
            }
        }
View Full Code Here


                    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." );
View Full Code Here

        throws Exception
    {
        super.setUp();
        object3 = new Object();
        object4 = new Object();
        plugin1 = new ReportPlugin();
        plugin1.setGroupId( null );
        plugin1.setArtifactId( null );
        plugin2 = new ReportPlugin();
        plugin2.setGroupId( null );
        plugin2.setArtifactId( null );
        plugin3 = new ReportPlugin();
        plugin3.setGroupId( "a" );
        plugin3.setArtifactId( "d" );
        plugin4 = new ReportPlugin();
        plugin4.setGroupId( "a" );
        plugin4.setArtifactId( "d" );
        plugin5 = new ReportPlugin();
        plugin5.setGroupId( "a" );
        plugin5.setArtifactId( "c" );
        plugin6 = new ReportPlugin();
        plugin6.setGroupId( "a" );
        plugin6.setArtifactId( "e" );
        plugin7 = new ReportPlugin();
        plugin7.setGroupId( "b" );
        plugin7.setArtifactId( "b" );
        plugin8 = new ReportPlugin();
        plugin8.setGroupId( "b" );
        plugin8.setArtifactId( "e" );
        plugin9 = new ReportPlugin();
        plugin9.setGroupId( null );
        plugin9.setArtifactId( "e" );
        plugin10 = new ReportPlugin();
        plugin10.setGroupId( "a" );
        plugin10.setArtifactId( null );
        comparator = new ReportPluginComparator();
    }
View Full Code Here

        }
       
        Iterator iterator = model.getReporting().getPlugins().iterator();
        while ( iterator.hasNext() )
        {
            ReportPlugin plugin = (ReportPlugin) iterator.next();
            if ( plugin.getGroupId().equals( groupId ) && plugin.getArtifactId().equals( artifactId ) )
            {
                return plugin;
            }
        }
        return null;
View Full Code Here

                    fireAddPluginEvent( plugin );
                }
            }
            else if ( TYPE_REPORT_PLUGIN.equals( getType() ) )
            {
                ReportPlugin plugin = ModelUtils.findReportPlugin( v4Model, getGroupId(), getArtifactId() );
                if ( plugin == null )
                {
                    addPlugin = true;
                    plugin = new ReportPlugin();
                    plugin.setGroupId( getGroupId() );
                    plugin.setArtifactId( getArtifactId() );
                }

                plugin.setConfiguration( configuration );

                if ( getReportSets() != null && !getReportSets().isEmpty() )
                {
                    plugin.setReportSets( getReportSets() );
                }

                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

        }
        if ( !( o2 instanceof ReportPlugin ) )
        {
            return 1;
        }
        ReportPlugin plugin1 = (ReportPlugin) o1;
        ReportPlugin plugin2 = (ReportPlugin) o2;

        // Check for null values
        if ( plugin1.getGroupId() == null && plugin2.getGroupId() == null )
        {
            return compareArtifactId( plugin1, plugin2 );
        }
        if ( plugin1.getGroupId() == null )
        {
            return -1;
        }
        if ( plugin2.getGroupId() == null )
        {
            return 1;
        }

        // Compare values
        int answer;
        answer = plugin1.getGroupId().compareTo( plugin2.getGroupId() );
        if ( answer == 0 )
        {
            answer = compareArtifactId( plugin1, plugin2 );
        }
View Full Code Here

                }
            }
        }

        // Relocate report plugins
        ReportPlugin oldReportPlugin = ModelUtils.findReportPlugin( v4Model, getOldGroupId(), getOldArtifactId() );
        if ( oldReportPlugin != null )
        {
            if ( getNewArtifactId() == null && getNewGroupId() == null )
            {
                // Remove the old plugin
                v4Model.getReporting().getPlugins().remove( oldReportPlugin );
                sendInfoMessage( "Removing report plugin " + getOldGroupId() + ":" + getOldArtifactId() );
                fireRemovePluginEvent( getOldGroupId(), getOldArtifactId() );
            }
            else
            {
                ReportPlugin newPlugin = ModelUtils.findReportPlugin( v4Model, getNewGroupId(), getNewArtifactId() );
                if ( newPlugin == null )
                {
                    // The new plugin does not exist, relocate the old one
                    oldReportPlugin.setArtifactId( getNewArtifactId() );
                    oldReportPlugin.setGroupId( getNewGroupId() );
View Full Code Here

     * @return ReportPlugin
     */
    private ReportPlugin parseReportPlugin( String tagName, XmlPullParser parser, boolean strict )
        throws IOException, XmlPullParserException
    {
        ReportPlugin reportPlugin = new ReportPlugin();
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( checkFieldWithDuplicate( parser, "groupId", null, parsed ) )
            {
                reportPlugin.setGroupId( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "artifactId", null, parsed ) )
            {
                reportPlugin.setArtifactId( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "version", null, parsed ) )
            {
                reportPlugin.setVersion( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "inherited", null, parsed ) )
            {
                reportPlugin.setInherited( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "configuration", null, parsed ) )
            {
                reportPlugin.setConfiguration( Xpp3DomBuilder.build( parser ) );
            }
            else if ( checkFieldWithDuplicate( parser, "reportSets", null, parsed ) )
            {
                java.util.List reportSets = new java.util.ArrayList/*<ReportSet>*/();
                reportPlugin.setReportSets( reportSets );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( parser.getName().equals( "reportSet" ) )
                    {
                        reportSets.add( parseReportSet( "reportSet", parser, strict ) );
View Full Code Here

            if ( ( reporting.getPlugins() != null ) && ( reporting.getPlugins().size() > 0 ) )
            {
                serializer.startTag( NAMESPACE, "plugins" );
                for ( Iterator iter = reporting.getPlugins().iterator(); iter.hasNext(); )
                {
                    ReportPlugin o = (ReportPlugin) iter.next();
                    writeReportPlugin( o, "plugin", serializer );
                }
                serializer.endTag( NAMESPACE, "plugins" );
            }
            serializer.endTag( NAMESPACE, tagName );
View Full Code Here

                elIt = null;
            }
            Counter innerCount = new Counter( counter.getDepth() + 1 );
            while ( it.hasNext() )
            {
                ReportPlugin value = (ReportPlugin) it.next();
                Element el;
                if ( elIt != null && elIt.hasNext() )
                {
                    el = (Element) elIt.next();
                    if ( !elIt.hasNext() )
View Full Code Here

TOP

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

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.