org.apache.maven.model.Plugin.setGroupId()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(142)

本文整理了Java中org.apache.maven.model.Plugin.setGroupId()方法的一些代码示例,展示了Plugin.setGroupId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Plugin.setGroupId()方法的具体详情如下:
包路径:org.apache.maven.model.Plugin
类名称:Plugin
方法名:setGroupId

Plugin.setGroupId介绍

[英]Set the group ID of the plugin in the repository.
[中]在存储库中设置插件的组ID。

代码示例

代码示例来源:origin: apache/maven

plugin.setGroupId( null );
mergePlugin( plugin, element, sourceDominant, context );

代码示例来源:origin: apache/maven

protected void mergePlugin_GroupId( Plugin target, Plugin source, boolean sourceDominant,
                  Map<Object, Object> context )
{
  String src = source.getGroupId();
  if ( src != null )
  {
    if ( sourceDominant || target.getGroupId() == null )
    {
      target.setGroupId( src );
      target.setLocation( "groupId", source.getLocation( "groupId" ) );
    }
  }
}

代码示例来源:origin: org.apache.maven/maven-project

private void mergeDeterministicPluginElements( List iPlugins, List dPlugins )
{
  if ( dPlugins != null )
  {
    for ( int i = 0; i < dPlugins.size(); i++ )
    {
      Plugin dPlugin = (Plugin) dPlugins.get( i );
      Plugin iPlugin = (Plugin) iPlugins.get( i );
      dPlugin.setGroupId( iPlugin.getGroupId() );
      dPlugin.setArtifactId( iPlugin.getArtifactId() );
      dPlugin.setVersion( iPlugin.getVersion() );
      
      dPlugin.setDependencies( iPlugin.getDependencies() );
      
      List dExecutions = dPlugin.getExecutions();
      if ( dExecutions != null )
      {
        List iExecutions = iPlugin.getExecutions();
        
        for ( int j = 0; j < dExecutions.size(); j++ )
        {
          PluginExecution dExec = (PluginExecution) dExecutions.get( j );
          PluginExecution iExec = (PluginExecution) iExecutions.get( j );
          
          dExec.setId( iExec.getId() );
        }
      }
    }
  }
}

代码示例来源:origin: apache/maven

plugin.setGroupId( tok.nextToken() );
plugin.setArtifactId( tok.nextToken() );
plugin.setVersion( tok.nextToken() );
plugin.setGroupId( tok.nextToken() );
plugin.setArtifactId( tok.nextToken() );
goal = tok.nextToken();

代码示例来源:origin: apache/maven

plugin.setGroupId( extension.getGroupId() );
plugin.setArtifactId( extension.getArtifactId() );
plugin.setVersion( extension.getVersion() );

代码示例来源:origin: apache/maven

public Plugin getPluginDefinitionForPrefix( String prefix, MavenSession session, MavenProject project )
{
  PluginPrefixRequest request = new DefaultPluginPrefixRequest( prefix, session );
  request.setPom( project.getModel() );
  try
  {
    PluginPrefixResult result = pluginPrefixResolver.resolve( request );
    Plugin plugin = new Plugin();
    plugin.setGroupId( result.getGroupId() );
    plugin.setArtifactId( result.getArtifactId() );
    return plugin;
  }
  catch ( NoPluginFoundForPrefixException e )
  {
    return null;
  }
}

代码示例来源:origin: apache/maven

plugin.setGroupId( gs.groupId );
plugin.setArtifactId( gs.artifactId );
plugin.setVersion( gs.version );

代码示例来源:origin: apache/maven

public PluginDescriptor getPluginDescriptorForPrefix( String prefix )
{
  MavenSession session = legacySupport.getSession();
  PluginPrefixRequest request = new DefaultPluginPrefixRequest( prefix, session );
  try
  {
    PluginPrefixResult result = pluginPrefixResolver.resolve( request );
    Plugin plugin = new Plugin();
    plugin.setGroupId( result.getGroupId() );
    plugin.setArtifactId( result.getArtifactId() );
    return loadPluginDescriptor( plugin, session.getCurrentProject(), session );
  }
  catch ( Exception e )
  {
    return null;
  }
}

代码示例来源:origin: apache/maven

private List<Artifact> resolveExtension( CoreExtension extension, RepositorySystemSession repoSession,
                       List<RemoteRepository> repositories, DependencyFilter dependencyFilter )
    throws PluginResolutionException
  {
    Plugin plugin = new Plugin();
    plugin.setGroupId( extension.getGroupId() );
    plugin.setArtifactId( extension.getArtifactId() );
    plugin.setVersion( extension.getVersion() );

    DependencyNode root =
      pluginDependenciesResolver.resolveCoreExtension( plugin, dependencyFilter, repositories, repoSession );
    PreorderNodeListGenerator nlg = new PreorderNodeListGenerator();
    root.accept( nlg );
    List<Artifact> artifacts = nlg.getArtifacts( false );

    return artifacts;
  }
}

代码示例来源:origin: apache/maven

private boolean isCompatible( PluginVersionRequest request, String version )
  plugin.setGroupId( request.getGroupId() );
  plugin.setArtifactId( request.getArtifactId() );
  plugin.setVersion( version );

代码示例来源:origin: apache/maven

pp.setGroupId( report.getGroupId() );
pp.setArtifactId( report.getArtifactId() );
pp.setVersion( report.getVersion() );

代码示例来源:origin: apache/maven

public Plugin findPluginForPrefix( String prefix, MavenSession session )
  throws NoPluginFoundForPrefixException
{
  // [prefix]:[goal]
  if ( session.getCurrentProject() != null )
  {
    try
    {
      lifecyclePluginResolver.resolveMissingPluginVersions( session.getCurrentProject(), session );
    }
    catch ( PluginVersionResolutionException e )
    {
      // not critical here
      logger.debug( e.getMessage(), e );
    }
  }
  PluginPrefixRequest prefixRequest = new DefaultPluginPrefixRequest( prefix, session );
  PluginPrefixResult prefixResult = pluginPrefixResolver.resolve( prefixRequest );
  Plugin plugin = new Plugin();
  plugin.setGroupId( prefixResult.getGroupId() );
  plugin.setArtifactId( prefixResult.getArtifactId() );
  return plugin;
}

代码示例来源:origin: apache/maven

plugin.setGroupId( interpolatedTrimmed( parser.nextText(), "groupId" ) );

代码示例来源:origin: org.apache.maven/maven-project

public static Plugin clonePlugin( Plugin src )
{
  Plugin result = null;
  if ( src != null )
  {
    result = new Plugin();
    result.setArtifactId( src.getArtifactId() );
    
    result.setConfiguration( cloneConfiguration( src.getConfiguration() ) );
    
    result.setDependencies( cloneList( src.getDependencies(), DEPENDENCY_CLONER ) );
    result.setExecutions( cloneList( src.getExecutions(), PLUGIN_EXECUTION_CLONER ) );
    
    result.setExtensions( src.isExtensions() );
    result.setGroupId( src.getGroupId() );
    result.setInherited( src.getInherited() );
    result.setVersion( src.getVersion() );
  }
  
  return result;
}

代码示例来源:origin: takari/polyglot-maven

public Plugin mergePlugin(Plugin plugin) {
 plugin.setGroupId(groupId);
 plugin.setArtifactId(artifactId);
 if(version != null) plugin.setVersion(version);
 return plugin;
}

代码示例来源:origin: takari/polyglot-maven

public PluginBuilder(String groupId, String artifactId) {
  plugin = new Plugin();	
  plugin.setGroupId(groupId);
  plugin.setArtifactId(artifactId);
}

代码示例来源:origin: apache/maven

plugin.setGroupId( interpolatedTrimmed( parser.nextText(), "groupId" ) );

代码示例来源:origin: takari/polyglot-maven

public PluginBuilder(String classifier) {
  plugin = new Plugin();
  String[] parts = classifier.split(":");
  if (parts.length == 2) {
    plugin.setGroupId(parts[0]);
    plugin.setArtifactId(parts[1]);
  } else if (parts.length == 3) {
    plugin.setVersion(parts[2]);
  }        
}

代码示例来源:origin: takari/polyglot-maven

public PluginBuilder(String groupId, String artifactId, String version) {
  plugin = new Plugin();	
  plugin.setGroupId(groupId);
  plugin.setArtifactId(artifactId);
  plugin.setVersion(version);
}

代码示例来源:origin: takari/polyglot-maven

private Plugin getPlugin(final Model model, String profileId, Map<String, Plugin> plugins) {
  Plugin plugin = plugins.get(profileId);
  if (plugin == null) {
   plugin = new Plugin();
   plugin.setGroupId(Constants.getGroupId());
   plugin.setArtifactId(Constants.getArtifactId("maven-plugin"));
   plugin.setVersion(Constants.getVersion());

   // Do not assume that the existing list is mutable.
   BuildBase build = getBuild(model, profileId);
   List<Plugin> existingPlugins = build.getPlugins();
   List<Plugin> mutablePlugins = new ArrayList<Plugin>(existingPlugins);
   build.setPlugins(mutablePlugins);
   build.addPlugin(plugin);

   plugins.put(profileId, plugin);
  }
  return plugin;
 }
}

相关文章