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


Java Plugin.getGroupId方法代码示例

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


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

示例1: visitBuildPlugin

import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
@Override
public void visitBuildPlugin( Plugin plugin )
{
    if ( isExternal( plugin.getLocation( "" ) ) )
        return;

    String groupId = plugin.getGroupId();
    String artifactId = plugin.getArtifactId();
    String version = plugin.getVersion();
    if ( StringUtils.isEmpty( groupId ) )
        groupId = "org.apache.maven.plugins";
    if ( StringUtils.isEmpty( version ) )
        version = Artifact.DEFAULT_VERSION;

    Artifact pluginArtifact = new DefaultArtifact( groupId, artifactId, version );
    artifacts.add( pluginArtifact );
}
 
开发者ID:fedora-java,项目名称:xmvn,代码行数:18,代码来源:BuildDependencyVisitor.java

示例2: convertPlugin

import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
private static MavenPlugin convertPlugin(Plugin plugin) {
  List<MavenPluginExecution> executions =
      plugin.getExecutions().stream().map(MavenModelUtil::convertExecution).collect(toList());

  List<MavenKey> dependecies =
      plugin
          .getDependencies()
          .stream()
          .map(
              dependency ->
                  new MavenKey(
                      dependency.getGroupId(),
                      dependency.getArtifactId(),
                      dependency.getVersion()))
          .collect(toList());

  return new MavenPlugin(
      plugin.getGroupId(),
      plugin.getArtifactId(),
      plugin.getVersion(),
      false,
      convertConfiguration(plugin.getConfiguration()),
      executions,
      dependecies);
}
 
开发者ID:eclipse,项目名称:che,代码行数:26,代码来源:MavenModelUtil.java

示例3: findPlugin

import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
/**
 * Returns the maven plugin for the given artifact id or returns null if it cannot be found
 */
public static Plugin findPlugin(List<Plugin> plugins, String artifactId) {
    if (plugins != null) {
        for (Plugin plugin : plugins) {
            String groupId = plugin.getGroupId();
            if (Strings.isNullOrBlank(groupId) || Objects.equal(groupId, mavenPluginsGroupId)) {
                if (Objects.equal(artifactId, plugin.getArtifactId())) {
                    return plugin;
                }
            }
        }
    }
    return null;
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:17,代码来源:MavenHelpers.java

示例4: getGroupId

import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
@Override
public String getGroupId(final Plugin origin) {
	return origin.getGroupId();
}
 
开发者ID:SourcePond,项目名称:release-maven-plugin-parent,代码行数:5,代码来源:PluginAdapter.java

示例5: addPluginAssociations

import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
/**
 * Takes a list of {@link org.apache.maven.model.Plugin} instances and adds associations to properties used to
 * define versions of the plugin artifact or any of the plugin dependencies specified in the pom.
 *
 * @param helper Our helper.
 * @param expressionEvaluator Our expression evaluator.
 * @param result The map of {@link org.codehaus.mojo.versions.api.PropertyVersionsBuilder} keyed by property name.
 * @param plugins The list of {@link org.apache.maven.model.Plugin}.
 * @throws ExpressionEvaluationException if an expression cannot be evaluated.
 */
private static void addPluginAssociations( VersionsHelper helper, ExpressionEvaluator expressionEvaluator,
                                           Map<String, PropertyVersionsBuilder> result, List<Plugin> plugins )
    throws ExpressionEvaluationException
{
    if ( plugins == null )
    {
        return;
    }
    for ( Plugin plugin : plugins )
    {
        String version = plugin.getVersion();
        if ( version != null && version.contains( "${" ) && version.indexOf( '}' ) != -1 )
        {
            version = StringUtils.deleteWhitespace( version );
            for ( PropertyVersionsBuilder property : result.values() )
            {
                // any of these could be defined by a property
                final String propertyRef = "${" + property.getName() + "}";
                if ( version.contains( propertyRef ) )
                {
                    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() );
                    }
                }
            }
        }
        addDependencyAssocations( helper, expressionEvaluator, result, plugin.getDependencies(), true );
    }
}
 
开发者ID:mojohaus,项目名称:versions-maven-plugin,代码行数:66,代码来源:PomHelper.java

示例6: toArtifact

import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
private Artifact toArtifact(Plugin plugin) {
    return new DefaultArtifact(plugin.getGroupId(), plugin.getArtifactId(), plugin.getVersion(), null, Constants.MAVEN_PLUGIN_TYPE, null, getArtifactHandler());
}
 
开发者ID:sundrio,项目名称:sundrio,代码行数:4,代码来源:GenerateBomMojo.java

示例7: addPluginAssociations

import org.apache.maven.model.Plugin; //导入方法依赖的package包/类
/**
 * Takes a list of {@link org.apache.maven.model.Plugin} instances and adds associations to properties used to
 * define versions of the plugin artifact or any of the plugin dependencies specified in the pom.
 *
 * @param helper              Our helper.
 * @param expressionEvaluator Our expression evaluator.
 * @param result              The map of {@link org.codehaus.mojo.versions.api.PropertyVersionsBuilder} keyed by property name.
 * @param plugins             The list of {@link org.apache.maven.model.Plugin}.
 * @throws ExpressionEvaluationException if an expression cannot be evaluated.
 */
private static void addPluginAssociations( VersionsHelper helper, ExpressionEvaluator expressionEvaluator,
                                           Map<String, PropertyVersionsBuilder> result, List<Plugin> plugins )
    throws ExpressionEvaluationException
{
    if ( plugins == null )
    {
        return;
    }
    for ( Plugin plugin : plugins )
    {
        String version = plugin.getVersion();
        if ( version != null && version.contains( "${" ) && version.indexOf( '}' ) != -1 )
        {
            version = StringUtils.deleteWhitespace( version );
            for ( PropertyVersionsBuilder property : result.values() )
            {
                // any of these could be defined by a property
                final String propertyRef = "${" + property.getName() + "}";
                if ( version.contains( propertyRef ) )
                {
                    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() );
                    }
                }
            }
        }
        addDependencyAssocations( helper, expressionEvaluator, result, plugin.getDependencies(), true );
    }
}
 
开发者ID:petr-ujezdsky,项目名称:versions-maven-plugin-svn-clone,代码行数:66,代码来源:PomHelper.java


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