public PluginLoaderException( Plugin plugin, String message, InvalidVersionSpecificationException cause ) { super( message, cause ); pluginKey = plugin.getKey(); }
public PluginLoaderException( Plugin plugin, String message, InvalidPluginException cause ) { super( message, cause ); pluginKey = plugin.getKey(); }
public PluginLoaderException( Plugin plugin, String message, ArtifactResolutionException cause ) { super( message, cause ); pluginKey = plugin.getKey(); }
public PluginLoaderException( Plugin plugin, String message, ArtifactNotFoundException cause ) { super( message, cause ); pluginKey = plugin.getKey(); }
public PluginLoaderException( Plugin plugin, String message, PluginManagerException cause ) { super( message, cause ); pluginKey = plugin.getKey(); }
public PluginLoaderException( Plugin plugin, String message, PluginVersionNotFoundException cause ) { super( message, cause ); pluginKey = plugin.getKey(); }
public PluginLoaderException( Plugin plugin, String message ) { super( message ); pluginKey = plugin.getKey(); }
public PluginLoaderException( Plugin plugin, String message, PluginNotFoundException cause ) { super( message, cause ); pluginKey = plugin.getKey(); }
public PluginLoaderException( Plugin plugin, String message, PluginVersionResolutionException cause ) { super( message, cause ); pluginKey = plugin.getKey(); }
@Override protected Object getPluginKey( Plugin plugin ) { return plugin.getKey(); }
/** * @see java.lang.Object#toString() */ public String toString() { return "Plugin [" + getKey() + "]"; }
/** * @see java.lang.Object#hashCode() */ public int hashCode() { return getKey().hashCode(); }
/** * @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; }
Plugin pmPlugin = (Plugin) pmPlugins.get( buildPlugin.getKey() );
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 ); } } }
/** * @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; }
public void addPlugin( Plugin plugin ) { Build build = getModelBuild(); if ( !build.getPluginsAsMap().containsKey( plugin.getKey() ) ) { injectPluginManagementInfo( plugin ); build.addPlugin( plugin ); build.flushPluginMap(); } }
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!" ); } } } } }
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" ); } } }