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


Java ReportPlugin.getVersion方法代码示例

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


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

示例1: getReportPluginVersion

import org.apache.maven.model.ReportPlugin; //导入方法依赖的package包/类
/**
 * Like {@link #getPluginVersion} but for report plugins.
 * @since 2.32
 */
public static @CheckForNull String getReportPluginVersion(@NonNull MavenProject prj, @NonNull String groupId, @NonNull String artifactId) {
    for (ReportPlugin plug : getEffectiveReportPlugins(prj)) {
        if (groupId.equals(plug.getGroupId()) && artifactId.equals(plug.getArtifactId())) {
            return plug.getVersion();
        }
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:PluginPropertyUtils.java

示例2: writeReportPlugin

import org.apache.maven.model.ReportPlugin; //导入方法依赖的package包/类
private void writeReportPlugin(ReportPlugin reportPlugin, String tagName, XmlSerializer serializer)
        throws java.io.IOException {
    serializer.startTag(NAMESPACE, tagName);
    flush(serializer);
    StringBuffer b = b(serializer);
    int start = b.length();
    if ((reportPlugin.getGroupId() != null) && !reportPlugin.getGroupId().equals("org.apache.maven.plugins")) {
        writeValue(serializer, "groupId", reportPlugin.getGroupId(), reportPlugin);
    }
    if (reportPlugin.getArtifactId() != null) {
        writeValue(serializer, "artifactId", reportPlugin.getArtifactId(), reportPlugin);
    }
    if (reportPlugin.getVersion() != null) {
        writeValue(serializer, "version", reportPlugin.getVersion(), reportPlugin);
    }
    if ((reportPlugin.getReportSets() != null) && (reportPlugin.getReportSets().size() > 0)) {
        serializer.startTag(NAMESPACE, "reportSets");
        for (Iterator iter = reportPlugin.getReportSets().iterator(); iter.hasNext();) {
            ReportSet o = (ReportSet) iter.next();
            writeReportSet(o, "reportSet", serializer);
        }
        serializer.endTag(NAMESPACE, "reportSets");
    }
    if (reportPlugin.getInherited() != null) {
        writeValue(serializer, "inherited", reportPlugin.getInherited(), reportPlugin);
    }
    if (reportPlugin.getConfiguration() != null) {
        writeXpp3DOM(serializer, (Xpp3Dom)reportPlugin.getConfiguration(), reportPlugin);
    }
    serializer.endTag(NAMESPACE, tagName).flush();
    logLocation(reportPlugin, "", start, b.length());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:33,代码来源:LocationAwareMavenXpp3Writer.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: addReportPluginAssociations

import org.apache.maven.model.ReportPlugin; //导入方法依赖的package包/类
private static void addReportPluginAssociations( VersionsHelper helper, ExpressionEvaluator expressionEvaluator,
                                                 Map<String, PropertyVersionsBuilder> result,
                                                 List<ReportPlugin> reportPlugins )
    throws ExpressionEvaluationException
{
    if ( reportPlugins == null )
    {
        return;
    }
    for ( ReportPlugin plugin : reportPlugins )
    {
        String version = plugin.getVersion();
        if ( version != null && version.contains( "${" ) && version.indexOf( '}' ) != -1 )
        {
            version = StringUtils.deleteWhitespace( version );
            for ( PropertyVersionsBuilder property : result.values() )
            {
                final String propertyRef = "${" + property.getName() + "}";
                if ( version.contains( propertyRef ) )
                {
                    // any of these could be defined by a property
                    String groupId = plugin.getGroupId();
                    if ( groupId == null || groupId.trim().length() == 0 )
                    {
                        // group Id has a special default
                        groupId = APACHE_MAVEN_PLUGINS_GROUPID;
                    }
                    else
                    {
                        groupId = (String) expressionEvaluator.evaluate( groupId );
                    }
                    String artifactId = plugin.getArtifactId();
                    if ( artifactId == null || artifactId.trim().length() == 0 )
                    {
                        // malformed pom
                        continue;
                    }
                    else
                    {
                        artifactId = (String) expressionEvaluator.evaluate( artifactId );
                    }
                    // might as well capture the current value
                    VersionRange versionRange =
                        VersionRange.createFromVersion( (String) expressionEvaluator.evaluate( plugin.getVersion() ) );
                    property.addAssociation( helper.createPluginArtifact( groupId, artifactId, versionRange ),
                                             true );
                    if ( !propertyRef.equals( version ) )
                    {
                        addBounds( property, version, propertyRef, versionRange.toString() );
                    }
                }
            }
        }
    }
}
 
开发者ID:mojohaus,项目名称:versions-maven-plugin,代码行数:56,代码来源:PomHelper.java

示例5: addReportPluginAssociations

import org.apache.maven.model.ReportPlugin; //导入方法依赖的package包/类
private static void addReportPluginAssociations( VersionsHelper helper, ExpressionEvaluator expressionEvaluator,
                                                 Map<String, PropertyVersionsBuilder> result,
                                                 List<ReportPlugin> reportPlugins )
    throws ExpressionEvaluationException
{
    if ( reportPlugins == null )
    {
        return;
    }
    for ( ReportPlugin plugin : reportPlugins )
    {
        String version = plugin.getVersion();
        if ( version != null && version.contains( "${" ) && version.indexOf( '}' ) != -1 )
        {
            version = StringUtils.deleteWhitespace( version );
            for ( PropertyVersionsBuilder property : result.values() )
            {
                final String propertyRef = "${" + property.getName() + "}";
                if ( version.contains( propertyRef ) )
                {
                    // any of these could be defined by a property
                    String groupId = plugin.getGroupId();
                    if ( groupId == null || groupId.trim().length() == 0 )
                    {
                        // group Id has a special default
                        groupId = APACHE_MAVEN_PLUGINS_GROUPID;
                    }
                    else
                    {
                        groupId = (String) expressionEvaluator.evaluate( groupId );
                    }
                    String artifactId = plugin.getArtifactId();
                    if ( artifactId == null || artifactId.trim().length() == 0 )
                    {
                        // malformed pom
                        continue;
                    }
                    else
                    {
                        artifactId = (String) expressionEvaluator.evaluate( artifactId );
                    }
                    // might as well capture the current value
                    VersionRange versionRange = VersionRange.createFromVersion(
                        (String) expressionEvaluator.evaluate( plugin.getVersion() ) );
                    property.addAssociation( helper.createPluginArtifact( groupId, artifactId, versionRange ),
                                             true );
                    if ( !propertyRef.equals( version ) )
                    {
                        addBounds( property, version, propertyRef, versionRange.toString() );
                    }
                }
            }
        }
    }
}
 
开发者ID:petr-ujezdsky,项目名称:versions-maven-plugin-svn-clone,代码行数:56,代码来源:PomHelper.java

示例6: 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.getVersion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。