public String getArtifactId() { if ( mojoDescriptor != null ) { return mojoDescriptor.getPluginDescriptor().getArtifactId(); } return plugin.getArtifactId(); }
public void validate( PluginDescriptor pluginDescriptor ) { /* * NOTE: For plugins that depend on other plugin artifacts the plugin realm contains more than one plugin * descriptor. However, only the first descriptor is of interest. */ if ( !firstDescriptor ) { return; } firstDescriptor = false; if ( !pluginArtifact.getGroupId().equals( pluginDescriptor.getGroupId() ) ) { errors.add( "Plugin's descriptor contains the wrong group ID: " + pluginDescriptor.getGroupId() ); } if ( !pluginArtifact.getArtifactId().equals( pluginDescriptor.getArtifactId() ) ) { errors.add( "Plugin's descriptor contains the wrong artifact ID: " + pluginDescriptor.getArtifactId() ); } if ( !pluginArtifact.getBaseVersion().equals( pluginDescriptor.getVersion() ) ) { errors.add( "Plugin's descriptor contains the wrong version: " + pluginDescriptor.getVersion() ); } }
messageBuffer.append( mojo.getPluginDescriptor().getArtifactId() ); messageBuffer.append( "\', specify the following:\n\n<configuration>\n ...\n" ); messageBuffer.append( " <" ).append( param.getName() ).append( '>' );
public PluginManagerException( MojoDescriptor mojoDescriptor, String message, MavenProject project, PlexusContainerException cause ) { super( message, cause ); this.project = project; PluginDescriptor pd = mojoDescriptor.getPluginDescriptor(); pluginGroupId = pd.getGroupId(); pluginArtifactId = pd.getArtifactId(); pluginVersion = pd.getVersion(); goal = mojoDescriptor.getGoal(); }
public PluginManagerException( MojoDescriptor mojoDescriptor, MavenProject project, String message, NoSuchRealmException cause ) { super( message, cause ); this.project = project; pluginGroupId = mojoDescriptor.getPluginDescriptor().getGroupId(); pluginArtifactId = mojoDescriptor.getPluginDescriptor().getArtifactId(); pluginVersion = mojoDescriptor.getPluginDescriptor().getVersion(); goal = mojoDescriptor.getGoal(); }
protected PluginManagerException( MojoDescriptor mojoDescriptor, String message, Throwable cause ) { super( message, cause ); pluginGroupId = mojoDescriptor.getPluginDescriptor().getGroupId(); pluginArtifactId = mojoDescriptor.getPluginDescriptor().getArtifactId(); pluginVersion = mojoDescriptor.getPluginDescriptor().getVersion(); goal = mojoDescriptor.getGoal(); }
protected PluginManagerException( MojoDescriptor mojoDescriptor, MavenProject project, String message ) { super( message ); this.project = project; pluginGroupId = mojoDescriptor.getPluginDescriptor().getGroupId(); pluginArtifactId = mojoDescriptor.getPluginDescriptor().getArtifactId(); pluginVersion = mojoDescriptor.getPluginDescriptor().getVersion(); goal = mojoDescriptor.getGoal(); }
protected PluginManagerException( MojoDescriptor mojoDescriptor, MavenProject project, String message, Throwable cause ) { super( message, cause ); this.project = project; pluginGroupId = mojoDescriptor.getPluginDescriptor().getGroupId(); pluginArtifactId = mojoDescriptor.getPluginDescriptor().getArtifactId(); pluginVersion = mojoDescriptor.getPluginDescriptor().getVersion(); goal = mojoDescriptor.getGoal(); }
protected static PluginDescriptor clone( PluginDescriptor original ) { PluginDescriptor clone = null; if ( original != null ) { clone = new PluginDescriptor(); clone.setGroupId( original.getGroupId() ); clone.setArtifactId( original.getArtifactId() ); clone.setVersion( original.getVersion() ); clone.setGoalPrefix( original.getGoalPrefix() ); clone.setInheritedByDefault( original.isInheritedByDefault() ); clone.setName( original.getName() ); clone.setDescription( original.getDescription() ); clone.setRequiredMavenVersion( original.getRequiredMavenVersion() ); clone.setPluginArtifact( ArtifactUtils.copyArtifactSafe( original.getPluginArtifact() ) ); clone.setComponents( clone( original.getMojos(), clone ) ); clone.setId( original.getId() ); clone.setIsolatedRealm( original.isIsolatedRealm() ); clone.setSource( original.getSource() ); clone.setDependencies( original.getDependencies() ); } return clone; }
protected void setUp() throws Exception { assertTrue( "Maven 3.2.4 or better is required", MAVEN_VERSION == null || new DefaultArtifactVersion( "3.2.3" ).compareTo( MAVEN_VERSION ) < 0 ); configurator = getContainer().lookup( ComponentConfigurator.class, "basic" ); InputStream is = getClass().getResourceAsStream( "/" + getPluginDescriptorLocation() ); XmlStreamReader reader = new XmlStreamReader( is ); InterpolationFilterReader interpolationFilterReader = new InterpolationFilterReader( new BufferedReader( reader ), container.getContext().getContextData() ); PluginDescriptor pluginDescriptor = new PluginDescriptorBuilder().build( interpolationFilterReader ); Artifact artifact = lookup( RepositorySystem.class ).createArtifact( pluginDescriptor.getGroupId(), pluginDescriptor.getArtifactId(), pluginDescriptor.getVersion(), ".jar" ); artifact.setFile( getPluginArtifactFile() ); pluginDescriptor.setPluginArtifact( artifact ); pluginDescriptor.setArtifacts( Arrays.asList( artifact ) ); for ( ComponentDescriptor<?> desc : pluginDescriptor.getComponents() ) { getContainer().addComponentDescriptor( desc ); } mojoDescriptors = new HashMap<String, MojoDescriptor>(); for ( MojoDescriptor mojoDescriptor : pluginDescriptor.getMojos() ) { mojoDescriptors.put( mojoDescriptor.getGoal(), mojoDescriptor ); } }
/** * {@inheritDoc} */ @Override public String getOutputName() { return pluginDescriptor.getArtifactId(); }
/** * {@inheritDoc} */ @Override public String getOutputName() { return pluginDescriptor.getArtifactId(); }
public String getPluginName() { return plugin.getArtifactId(); }
public String getPluginName() { return plugin.getArtifactId(); }
ManifestTransformer(PluginDescriptor pluginDescriptor) { pluginArtifactId = pluginDescriptor.getArtifactId(); pluginVersion = pluginDescriptor.getVersion(); }
/** * Returns conventional MojoExecution identifier used by incremental build tools. */ public String getExecutionId(MojoExecution execution) { PluginDescriptor pluginDescriptor = execution.getMojoDescriptor().getPluginDescriptor(); StringBuilder builderId = new StringBuilder(); builderId.append(pluginDescriptor.getGroupId()).append('_') .append(pluginDescriptor.getArtifactId()); builderId.append('_').append(execution.getGoal()).append('_') .append(execution.getExecutionId()); return builderId.toString(); }
private Properties createGeneratorProperties() { final Properties props = new Properties(); final PluginDescriptor descriptor = (PluginDescriptor) getPluginContext().get("pluginDescriptor"); //$NON-NLS-1$ props.put("generator.name", Strings.emptyIfNull(descriptor.getArtifactId())); //$NON-NLS-1$ props.put("generator.version", Strings.emptyIfNull(descriptor.getVersion())); //$NON-NLS-1$ return props; }
public PluginName(PluginDescriptor pd) { this(pd.getGroupId(), pd.getArtifactId(), pd.getVersion()); }
protected boolean isExmlProject() { for(Object o : getProject().getBuildPlugins()) { Plugin plugin = (Plugin) o; if (plugin.getGroupId().equals(pluginDescriptor.getGroupId()) && plugin.getArtifactId().equals(pluginDescriptor.getArtifactId())) { return plugin.isExtensions(); } } return false; } }
private File getThisPluginAsDependency() { ComponentDependency dep = new ComponentDependency(); dep.setGroupId(plugin.getGroupId()); dep.setArtifactId(plugin.getArtifactId()); dep.setVersion(plugin.getVersion()); return getDependencyFile(dep); }