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

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

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

Plugin.getKey介绍

暂无

代码示例

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

public PluginLoaderException( Plugin plugin, String message, InvalidVersionSpecificationException cause )
{
  super( message, cause );
  pluginKey = plugin.getKey();
}

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

public PluginLoaderException( Plugin plugin, String message, InvalidPluginException cause )
{
  super( message, cause );
  pluginKey = plugin.getKey();
}

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

public PluginLoaderException( Plugin plugin, String message, ArtifactResolutionException cause )
{
  super( message, cause );
  pluginKey = plugin.getKey();
}

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

public PluginLoaderException( Plugin plugin, String message, ArtifactNotFoundException cause )
{
  super( message, cause );
  pluginKey = plugin.getKey();
}

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

public PluginLoaderException( Plugin plugin, String message, PluginManagerException cause )
{
  super( message, cause );
  pluginKey = plugin.getKey();
}

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

public PluginLoaderException( Plugin plugin, String message, PluginVersionNotFoundException cause )
{
  super( message, cause );
  pluginKey = plugin.getKey();
}

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

public PluginLoaderException( Plugin plugin, String message )
{
  super( message );
  pluginKey = plugin.getKey();
}

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

public PluginLoaderException( Plugin plugin, String message, PluginNotFoundException cause )
{
  super( message, cause );
  pluginKey = plugin.getKey();
}

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

public PluginLoaderException( Plugin plugin, String message, PluginVersionResolutionException cause )
{
  super( message, cause );
  pluginKey = plugin.getKey();
}

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

@Override
protected Object getPluginKey( Plugin plugin )
{
  return plugin.getKey();
}

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

/**
 * @see java.lang.Object#toString()
 */
public String toString()
{
  return "Plugin [" + getKey() + "]";
}

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

/**
 * @see java.lang.Object#equals(java.lang.Object)
 */
public boolean equals( Object other )
{
  if ( other instanceof Plugin )
  {
    Plugin otherPlugin = (Plugin) other;
    return getKey().equals( otherPlugin.getKey() );
  }
  return false;
}

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

/**
 * @see java.lang.Object#hashCode()
 */
public int hashCode()
{
  return getKey().hashCode();
}

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

/**
 * @return a Map of plugins field with <code>Plugins#getKey()</code> as key
 * @see org.apache.maven.model.Plugin#getKey()
 */
public synchronized java.util.Map<String, Plugin> getPluginsAsMap()
{
  if ( pluginMap == null )
  {
    pluginMap = new java.util.LinkedHashMap<String, Plugin>();
    if ( plugins != null )
    {
      for ( java.util.Iterator<Plugin> it = plugins.iterator(); it.hasNext(); )
      {
        Plugin plugin = (Plugin) it.next();
        pluginMap.put( plugin.getKey(), plugin );
      }
    }
  }
  return pluginMap;
}

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

Plugin pmPlugin = (Plugin) pmPlugins.get( buildPlugin.getKey() );

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

public void injectPluginManagementInfo( Plugin plugin )
{
  PluginManagement pm = getModelBuild().getPluginManagement();
  if ( pm != null )
  {
    Map pmByKey = pm.getPluginsAsMap();
    String pluginKey = plugin.getKey();
    if ( pmByKey != null && pmByKey.containsKey( pluginKey ) )
    {
      Plugin pmPlugin = (Plugin) pmByKey.get( pluginKey );
      ModelUtils.mergePluginDefinitions( plugin, pmPlugin, false );
    }
  }
}

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

/**
 * @return a Map of executions field with <code>PluginExecution#getId()</code> as key
 * @see org.apache.maven.model.PluginExecution#getId()
 */
public java.util.Map<String, PluginExecution> getExecutionsAsMap()
{
  if ( executionMap == null )
  {
    executionMap = new java.util.LinkedHashMap<String, PluginExecution>();
    if ( getExecutions() != null )
    {
      for ( java.util.Iterator<PluginExecution> i = getExecutions().iterator(); i.hasNext(); )
      {
        PluginExecution exec = (PluginExecution) i.next();
        if ( executionMap.containsKey( exec.getId() ) )
        {
          throw new IllegalStateException( "You cannot have two plugin executions with the same (or missing) <id/> elements.\nOffending execution\n\nId: \'" + exec.getId() + "\'\nPlugin:\'" + getKey() + "\'\n\n" );
        }
        executionMap.put( exec.getId(), exec );
      }
    }
  }
  return executionMap;
}

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

public void addPlugin( Plugin plugin )
{
  Build build = getModelBuild();
  if ( !build.getPluginsAsMap().containsKey( plugin.getKey() ) )
  {
    injectPluginManagementInfo( plugin );
    build.addPlugin( plugin );
    build.flushPluginMap();
  }
}

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

private void validateProjects( List<MavenProject> projects )
{
  Map<String, MavenProject> projectsMap = new HashMap<>();
  for ( MavenProject p : projects )
  {
    String projectKey = ArtifactUtils.key( p.getGroupId(), p.getArtifactId(), p.getVersion() );
    projectsMap.put( projectKey, p );
  }
  for ( MavenProject project : projects )
  {
    // MNG-1911 / MNG-5572: Building plugins with extensions cannot be part of reactor
    for ( Plugin plugin : project.getBuildPlugins() )
    {
      if ( plugin.isExtensions() )
      {
        String pluginKey = ArtifactUtils.key( plugin.getGroupId(), plugin.getArtifactId(),
                           plugin.getVersion() );
        if ( projectsMap.containsKey( pluginKey ) )
        {
          logger.warn( project.getName() + " uses " + plugin.getKey()
            + " as extensions, which is not possible within the same reactor build. "
            + "This plugin was pulled from the local repository!" );
        }
      }
    }
  }
}

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

private void validate20EffectivePluginDependencies( ModelProblemCollector problems, Plugin plugin,
                          ModelBuildingRequest request )
{
  List<Dependency> dependencies = plugin.getDependencies();
  if ( !dependencies.isEmpty() )
  {
    String prefix = "build.plugins.plugin[" + plugin.getKey() + "].dependencies.dependency.";
    Severity errOn30 = getSeverity( request, ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_3_0 );
    for ( Dependency d : dependencies )
    {
      validateEffectiveDependency( problems, d, false, prefix, request );
      validateVersion( prefix + "version", problems, errOn30, Version.BASE, d.getVersion(),
               d.getManagementKey(), d );
      validateEnum( prefix + "scope", problems, errOn30, Version.BASE, d.getScope(), d.getManagementKey(), d,
             "compile", "runtime", "system" );
    }
  }
}

相关文章