当前位置: 首页>>代码示例>>Java>>正文


Java ReportPlugin.setVersion方法代码示例

本文整理汇总了Java中org.apache.maven.model.ReportPlugin.setVersion方法的典型用法代码示例。如果您正苦于以下问题:Java ReportPlugin.setVersion方法的具体用法?Java ReportPlugin.setVersion怎么用?Java ReportPlugin.setVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.maven.model.ReportPlugin的用法示例。


在下文中一共展示了ReportPlugin.setVersion方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getEffectiveReportPlugins

import org.apache.maven.model.ReportPlugin; //导入方法依赖的package包/类
/**
 * Should handle both deprecated 2.x-style report section, and 3.x-style Site Plugin config.
 * https://jira.codehaus.org/browse/MSITE-484 and https://jira.codehaus.org/browse/MSITE-443 if and when implemented may require updates.
 */
private static @NonNull Iterable<ReportPlugin> getEffectiveReportPlugins(@NonNull MavenProject prj) {
    List<ReportPlugin> plugins = new ArrayList<ReportPlugin>();
    for (Plugin plug : prj.getBuildPlugins()) {
        if (Constants.GROUP_APACHE_PLUGINS.equals(plug.getGroupId()) && Constants.PLUGIN_SITE.equals(plug.getArtifactId())) {
            Xpp3Dom cfg = (Xpp3Dom) plug.getConfiguration(); // MNG-4862
            if (cfg == null) {
                continue;
            }
            Xpp3Dom reportPlugins = cfg.getChild("reportPlugins");
            if (reportPlugins == null) {
                continue;
            }
            for (Xpp3Dom plugin : reportPlugins.getChildren("plugin")) {
                ReportPlugin p = new ReportPlugin();
                Xpp3Dom groupId = plugin.getChild("groupId");
                if (groupId != null) {
                    p.setGroupId(groupId.getValue());
                }
                Xpp3Dom artifactId = plugin.getChild("artifactId");
                if (artifactId != null) {
                    p.setArtifactId(artifactId.getValue());
                }
                Xpp3Dom version = plugin.getChild("version");
                if (version != null) {
                    p.setVersion(version.getValue());
                }
                p.setConfiguration(plugin.getChild("configuration"));
                // XXX reportSets
                // maven-site-plugin does not appear to apply defaults from plugin.xml (unlike 2.x?)
                plugins.add(p);
            }
        }
    }
    @SuppressWarnings("deprecation") List<ReportPlugin> m2Plugins = prj.getReportPlugins();
    plugins.addAll(m2Plugins);
    return plugins;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:42,代码来源:PluginPropertyUtils.java

示例2: toReportPlugin

import org.apache.maven.model.ReportPlugin; //导入方法依赖的package包/类
private static ReportPlugin toReportPlugin( Plugin plugin )
{
    ReportPlugin reportPlugin = new ReportPlugin();
    reportPlugin.setGroupId( plugin.getGroupId() );
    reportPlugin.setArtifactId( plugin.getArtifactId() );
    reportPlugin.setVersion( plugin.getVersion() );
    return reportPlugin;
}
 
开发者ID:mojohaus,项目名称:versions-maven-plugin,代码行数:9,代码来源:DisplayPluginUpdatesMojo.java

示例3: mergeReportPlugin_Version

import org.apache.maven.model.ReportPlugin; //导入方法依赖的package包/类
protected void mergeReportPlugin_Version( ReportPlugin target, ReportPlugin source, boolean sourceDominant,
                                          Map<Object, Object> context )
{
    String src = source.getVersion();
    if ( src != null )
    {
        if ( sourceDominant || target.getVersion() == null )
        {
            target.setVersion( src );
            target.setLocation( "version", source.getLocation( "version" ) );
        }
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:14,代码来源:ModelMerger.java

示例4: mergeReportPluginDefinitions

import org.apache.maven.model.ReportPlugin; //导入方法依赖的package包/类
public static void mergeReportPluginDefinitions( ReportPlugin child, ReportPlugin parent,
                                                 boolean handleAsInheritance )
{
    if ( ( child == null ) || ( parent == null ) )
    {
        // nothing to do.
        return;
    }

    if ( ( child.getVersion() == null ) && ( parent.getVersion() != null ) )
    {
        child.setVersion( parent.getVersion() );
    }

    // from here to the end of the method is dealing with merging of the <executions/> section.
    String parentInherited = parent.getInherited();

    boolean parentIsInherited = ( parentInherited == null ) || Boolean.valueOf( parentInherited ).booleanValue();

    List parentReportSets = parent.getReportSets();

    if ( ( parentReportSets != null ) && !parentReportSets.isEmpty() )
    {
        Map assembledReportSets = new TreeMap();

        Map childReportSets = child.getReportSetsAsMap();

        for ( Iterator it = parentReportSets.iterator(); it.hasNext(); )
        {
            ReportSet parentReportSet = (ReportSet) it.next();

            if ( !handleAsInheritance || parentIsInherited )
            {
                ReportSet assembledReportSet = parentReportSet;

                ReportSet childReportSet = (ReportSet) childReportSets.get( parentReportSet.getId() );

                if ( childReportSet != null )
                {
                    mergeReportSetDefinitions( childReportSet, parentReportSet );

                    assembledReportSet = childReportSet;
                }
                else if ( handleAsInheritance && ( parentInherited == null ) )
                {
                    parentReportSet.unsetInheritanceApplied();
                }

                assembledReportSets.put( assembledReportSet.getId(), assembledReportSet );
            }
        }

        for ( Iterator it = childReportSets.entrySet().iterator(); it.hasNext(); )
        {
            Map.Entry entry = (Map.Entry) it.next();

            String id = (String) entry.getKey();

            if ( !assembledReportSets.containsKey( id ) )
            {
                assembledReportSets.put( id, entry.getValue() );
            }
        }

        child.setReportSets( new ArrayList( assembledReportSets.values() ) );

        child.flushReportSetMap();
    }

}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:71,代码来源:DefaultModelInheritanceAssembler.java


注:本文中的org.apache.maven.model.ReportPlugin.setVersion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。