Java 类org.apache.maven.model.Reporting 实例源码

项目:incubator-netbeans    文件:LocationAwareMavenXpp3Writer.java   
private void writeReporting(Reporting reporting, String tagName, XmlSerializer serializer)
        throws java.io.IOException {
    serializer.startTag(NAMESPACE, tagName);
    flush(serializer);
    StringBuffer b = b(serializer);
    int start = b.length();
    if (reporting.getExcludeDefaults() != null) {
        writeValue(serializer, "excludeDefaults", reporting.getExcludeDefaults(), reporting);
    }
    if (reporting.getOutputDirectory() != null) {
        writeValue(serializer, "outputDirectory", reporting.getOutputDirectory(), reporting);
    }
    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).flush();
    logLocation(reporting, "", start, b.length());
}
项目:xmvn    文件:DefaultModelProcessor.java   
private void visitProfileReporting( ModelVisitor visitor, Reporting reporting )
{
    List<ReportPlugin> plugins = reporting.getPlugins();
    if ( plugins != null )
    {
        ListIterator<ReportPlugin> pluginIterator = plugins.listIterator();
        while ( pluginIterator.hasNext() )
        {
            ReportPlugin plugin = pluginIterator.next();
            visitor.visitProfileReportingPlugin( plugin );
            visitProfileReportingPlugin( visitor, plugin );
            plugin = visitor.replaceProfileReportingPlugin( plugin );
            if ( plugin == null )
                pluginIterator.remove();
            else
                pluginIterator.set( plugin );
        }
    }
}
项目:xmvn    文件:DefaultModelProcessor.java   
private void visitReporting( ModelVisitor visitor, Reporting reporting )
{
    List<ReportPlugin> plugins = reporting.getPlugins();
    if ( plugins != null )
    {
        ListIterator<ReportPlugin> pluginIterator = plugins.listIterator();
        while ( pluginIterator.hasNext() )
        {
            ReportPlugin plugin = pluginIterator.next();
            visitor.visitReportingPlugin( plugin );
            visitReportingPlugin( visitor, plugin );
            plugin = visitor.replaceReportingPlugin( plugin );
            if ( plugin == null )
                pluginIterator.remove();
            else
                pluginIterator.set( plugin );
        }
    }
}
项目:oceano    文件:DefaultReportConfigurationExpander.java   
public void expandPluginConfiguration( Model model, ModelBuildingRequest request, ModelProblemCollector problems )
{
    Reporting reporting = model.getReporting();

    if ( reporting != null )
    {
        for ( ReportPlugin reportPlugin : reporting.getPlugins() )
        {
            Xpp3Dom parentDom = (Xpp3Dom) reportPlugin.getConfiguration();

            if ( parentDom != null )
            {
                for ( ReportSet execution : reportPlugin.getReportSets() )
                {
                    Xpp3Dom childDom = (Xpp3Dom) execution.getConfiguration();
                    childDom = Xpp3Dom.mergeXpp3Dom( childDom, new Xpp3Dom( parentDom ) );
                    execution.setConfiguration( childDom );
                }
            }
        }
    }
}
项目:apache-maven-shade-plugin    文件:MavenJDOMWriter.java   
/**
 * Method updateReporting
 *
 * @param value
 * @param element
 * @param counter
 * @param xmlTag
 */
protected void updateReporting( Reporting value, String xmlTag, Counter counter, Element element )
{
    boolean shouldExist = value != null;
    Element root = updateElement( counter, element, xmlTag, shouldExist );
    if ( shouldExist )
    {
        Counter innerCount = new Counter( counter.getDepth() + 1 );
        findAndReplaceSimpleElement( innerCount, root, "excludeDefaults", !value.isExcludeDefaults() ? null
                        : String.valueOf( value.isExcludeDefaults() ), "false" );
        findAndReplaceSimpleElement( innerCount, root, "outputDirectory", value.getOutputDirectory(), null );
        iterateReportPlugin( innerCount, root, value.getPlugins(), "plugins", "plugin" );
    }
}
项目:maven-shade-plugin    文件:MavenJDOMWriter.java   
/**
 * Method updateReporting
 *
 * @param value
 * @param element
 * @param counter
 * @param xmlTag
 */
protected void updateReporting( Reporting value, String xmlTag, Counter counter, Element element )
{
    boolean shouldExist = value != null;
    Element root = updateElement( counter, element, xmlTag, shouldExist );
    if ( shouldExist )
    {
        Counter innerCount = new Counter( counter.getDepth() + 1 );
        findAndReplaceSimpleElement( innerCount, root, "excludeDefaults", !value.isExcludeDefaults()
            ? null
            : String.valueOf( value.isExcludeDefaults() ), "false" );
        findAndReplaceSimpleElement( innerCount, root, "outputDirectory", value.getOutputDirectory(), null );
        iterateReportPlugin( innerCount, root, value.getPlugins(), "plugins", "plugin" );
    }
}
项目:oceano    文件:ModelMerger.java   
protected void mergeReporting( Reporting target, Reporting source, boolean sourceDominant,
                               Map<Object, Object> context )
{
    mergeReporting_OutputDirectory( target, source, sourceDominant, context );
    mergeReporting_ExcludeDefaults( target, source, sourceDominant, context );
    mergeReporting_Plugins( target, source, sourceDominant, context );
}
项目:oceano    文件:ModelMerger.java   
protected void mergeReporting_OutputDirectory( Reporting target, Reporting source, boolean sourceDominant,
                                               Map<Object, Object> context )
{
    String src = source.getOutputDirectory();
    if ( src != null )
    {
        if ( sourceDominant || target.getOutputDirectory() == null )
        {
            target.setOutputDirectory( src );
            target.setLocation( "outputDirectory", source.getLocation( "outputDirectory" ) );
        }
    }
}
项目:oceano    文件:ModelMerger.java   
protected void mergeReporting_ExcludeDefaults( Reporting target, Reporting source, boolean sourceDominant,
                                               Map<Object, Object> context )
{
    String src = source.getExcludeDefaults();
    if ( src != null )
    {
        if ( sourceDominant || target.getExcludeDefaults() == null )
        {
            target.setExcludeDefaults( src );
            target.setLocation( "excludeDefaults", source.getLocation( "excludeDefaults" ) );
        }
    }
}
项目:Pogamut3    文件:DependencyProjectStub.java   
public Reporting getReporting()
{
    return null;
}
项目:sonar-scanner-maven    文件:MavenPlugin.java   
/**
 * Returns a plugin from a pom based on its group id and artifact id
 * <p>
 * It searches in the build section, then the reporting section and finally the pluginManagement section
 * </p>
 *
 * @param pom the project pom
 * @param groupId the plugin group id
 * @param artifactId the plugin artifact id
 * @return the plugin if it exists, null otherwise
 */
@CheckForNull
public static MavenPlugin getPlugin(MavenProject pom, String groupId, String artifactId) {
  Object pluginConfiguration = null;

  // look for plugin in <build> section
  Plugin plugin = getPlugin(pom.getBuildPlugins(), groupId, artifactId);

  if (plugin != null) {
    pluginConfiguration = plugin.getConfiguration();
  } else {
    // look for plugin in reporting
    Reporting reporting = pom.getModel().getReporting();
    if (reporting != null) {
      ReportPlugin reportPlugin = getReportPlugin(reporting.getPlugins(), groupId, artifactId);
      if (reportPlugin != null) {
        pluginConfiguration = reportPlugin.getConfiguration();
      }
    }
  }

  // look for plugin in <pluginManagement> section
  PluginManagement pluginManagement = pom.getPluginManagement();
  if (pluginManagement != null) {
    Plugin pluginFromManagement = getPlugin(pluginManagement.getPlugins(), groupId, artifactId);
    if (pluginFromManagement != null) {
      Object pluginConfigFromManagement = pluginFromManagement.getConfiguration();
      if (pluginConfiguration == null) {
        pluginConfiguration = pluginConfigFromManagement;
      } else if (pluginConfigFromManagement != null) {
        Xpp3Dom.mergeXpp3Dom((Xpp3Dom) pluginConfiguration, (Xpp3Dom) pluginConfigFromManagement);
      }
    }
  }

  if (pluginConfiguration != null) {
    return new MavenPlugin(pluginConfiguration);
  }
  return null;

}
项目:xmvn    文件:AbstractModelVisitor.java   
@Override
public Reporting replaceProfileReporting( Reporting reporting )
{
    return reporting;
}
项目:xmvn    文件:AbstractModelVisitor.java   
@Override
public Reporting replaceReporting( Reporting reporting )
{
    return reporting;
}
项目:xmvn    文件:AbstractModelVisitor.java   
@Override
public void visitProfileReporting( Reporting reporting )
{
}
项目:xmvn    文件:AbstractModelVisitor.java   
@Override
public void visitReporting( Reporting reporting )
{
}
项目:flatten-maven-plugin    文件:PomProperty.java   
@Override
public Reporting get( Model model )
{
    return model.getReporting();
}
项目:flatten-maven-plugin    文件:PomProperty.java   
@Override
public void set( Model model, Reporting value )
{
    model.setReporting( value );
}
项目:spdx-maven-plugin    文件:CreateSpdxMavenProjectStub.java   
public CreateSpdxMavenProjectStub() {
    MavenXpp3Reader pomReader = new MavenXpp3Reader();
    Model model;
    try
    {
        model = pomReader.read( ReaderFactory.newXmlReader( new File( getBasedir(), "pom.xml" ) ) );
        setModel( model );
    }
    catch ( Exception e )
    {
        throw new RuntimeException( e );
    }

    setGroupId( model.getGroupId() );
    setArtifactId( model.getArtifactId() );
    setVersion( model.getVersion() );
    setName( model.getName() );
    setUrl( model.getUrl() );
    setPackaging( model.getPackaging() );

    Build build = new Build();
    build.setFinalName( model.getArtifactId() );
    build.setDirectory( getBasedir() + "/target" );
    build.setSourceDirectory( getBasedir() + "/src/main/java" );
    build.setOutputDirectory( getBasedir() + "/target/classes" );
    build.setTestSourceDirectory( getBasedir() + "/src/test/java" );
    build.setTestOutputDirectory( getBasedir() + "/target/test-classes" );
    setBuild( build );

    Reporting reporting = new Reporting();
    reporting.setOutputDirectory( getBaseDir() + "/target/site" );
    setReporting( reporting );

    List<String> compileSourceRoots = new ArrayList<String>();
    compileSourceRoots.add( getBasedir() + "/src/main/java" );
    setCompileSourceRoots( compileSourceRoots );

    List<String> testCompileSourceRoots = new ArrayList<String>();
    testCompileSourceRoots.add( getBasedir() + "/src/test/java" );
    setTestCompileSourceRoots( testCompileSourceRoots );
}
项目:oceano    文件:MavenProject.java   
@Deprecated
public void setReporting( Reporting reporting )
{
    getModel().setReporting( reporting );
}
项目:oceano    文件:MavenProject.java   
@Deprecated
public Reporting getReporting()
{
    return getModel().getReporting();
}
项目:jwrapper-maven-plugin    文件:MavenProjectDelegate.java   
@Override
public void setReporting(final Reporting reporting) {
    getDelegate().setReporting(reporting);
}
项目:jwrapper-maven-plugin    文件:MavenProjectDelegate.java   
@Override
public Reporting getReporting() {
    return getDelegate().getReporting();
}
项目:Pogamut3    文件:DependencyProjectStub.java   
public void setReporting( Reporting reporting )
{

}
项目:xmvn    文件:ModelVisitor.java   
Reporting replaceProfileReporting( Reporting reporting );
项目:xmvn    文件:ModelVisitor.java   
Reporting replaceReporting( Reporting reporting );
项目:xmvn    文件:ModelVisitor.java   
void visitProfileReporting( Reporting reporting );
项目:xmvn    文件:ModelVisitor.java   
void visitReporting( Reporting reporting );