public int hashCode() { return 10 + getId().hashCode(); }
public int hashCode() { return 10 + getId().hashCode(); }
private InputStream getDescriptorStream( String descriptor ) throws IOException { File pluginFile = ( pluginArtifact != null ) ? pluginArtifact.getFile() : null; if ( pluginFile == null ) { throw new IllegalStateException( "plugin main artifact has not been resolved for " + getId() ); } if ( pluginFile.isFile() ) { try { return new URL( "jar:" + pluginFile.toURI() + "!/" + descriptor ).openStream(); } catch ( MalformedURLException e ) { throw new IllegalStateException( e ); } } else { return new FileInputStream( new File( pluginFile, descriptor ) ); } }
private InputStream getDescriptorStream( String descriptor ) throws IOException { File pluginFile = ( pluginArtifact != null ) ? pluginArtifact.getFile() : null; if ( pluginFile == null ) { throw new IllegalStateException( "plugin main artifact has not been resolved for " + getId() ); } if ( pluginFile.isFile() ) { try { return new URL( "jar:" + pluginFile.toURI() + "!/" + descriptor ).openStream(); } catch ( MalformedURLException e ) { throw new IllegalStateException( e ); } } else { return new FileInputStream( new File( pluginFile, descriptor ) ); } }
/** * @return the id of the mojo, based on the goal name */ public String getId() { return getPluginDescriptor().getId() + ":" + getGoal(); }
private static String toMessage( String goal, PluginDescriptor pluginDescriptor ) { StringBuilder buffer = new StringBuilder( 256 ); buffer.append( "Could not find goal '" ).append( goal ).append( '\'' ); if ( pluginDescriptor != null ) { buffer.append( " in plugin " ).append( pluginDescriptor.getId() ); buffer.append( " among available goals " ); List<MojoDescriptor> mojos = pluginDescriptor.getMojos(); if ( mojos != null ) { for ( Iterator<MojoDescriptor> it = mojos.iterator(); it.hasNext(); ) { MojoDescriptor mojo = it.next(); if ( mojo != null ) { buffer.append( mojo.getGoal() ); } if ( it.hasNext() ) { buffer.append( ", " ); } } } } return buffer.toString(); }
private static String toMessage( String goal, PluginDescriptor pluginDescriptor ) { StringBuilder buffer = new StringBuilder( 256 ); buffer.append( "Could not find goal '" ).append( goal ).append( '\'' ); if ( pluginDescriptor != null ) { buffer.append( " in plugin " ).append( pluginDescriptor.getId() ); buffer.append( " among available goals " ); List<MojoDescriptor> mojos = pluginDescriptor.getMojos(); if ( mojos != null ) { for ( Iterator<MojoDescriptor> it = mojos.iterator(); it.hasNext(); ) { MojoDescriptor mojo = it.next(); if ( mojo != null ) { buffer.append( mojo.getGoal() ); } if ( it.hasNext() ) { buffer.append( ", " ); } } } } return buffer.toString(); }
/** * @return the id of the mojo, based on the goal name */ public String getId() { return getPluginDescriptor().getId() + ":" + getGoal(); }
public void checkRequiredMavenVersion( PluginDescriptor pluginDescriptor ) throws PluginIncompatibleException { String requiredMavenVersion = pluginDescriptor.getRequiredMavenVersion(); if ( StringUtils.isNotBlank( requiredMavenVersion ) ) { try { if ( !runtimeInformation.isMavenVersion( requiredMavenVersion ) ) { throw new PluginIncompatibleException( pluginDescriptor.getPlugin(), "The plugin " + pluginDescriptor.getId() + " requires Maven version " + requiredMavenVersion ); } } catch ( RuntimeException e ) { logger.warn( "Could not verify plugin's Maven prerequisite: " + e.getMessage() ); } } }
PrintStream ps = new PrintStream( os ); ps.println( "Unable to load the mojo '" + mojoDescriptor.getGoal() + "' in the plugin '" + pluginDescriptor.getId() + "'. A required class is missing: " + cause.getMessage() ); pluginRealm.display( ps ); PrintStream ps = new PrintStream( os ); ps.println( "Unable to load the mojo '" + mojoDescriptor.getGoal() + "' in the plugin '" + pluginDescriptor.getId() + "' due to an API incompatibility: " + e.getClass().getName() + ": " + cause.getMessage() ); pluginRealm.display( ps ); "Unable to load the mojo '" + mojoDescriptor.getGoal() + "' (or one of its required components) from the plugin '" + pluginDescriptor.getId() + "'", e );
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; }
public int hashCode() { return 10 + getId().hashCode(); }
public int hashCode() { return 10 + getId().hashCode(); }
private String getSitePluginInfo() { PluginDescriptor pluginDescriptor = (PluginDescriptor) getPluginContext().get( "pluginDescriptor" ); return pluginDescriptor.getId(); } protected void populateReportItems( DecorationModel decorationModel, Locale locale,
/** * @return the id of the mojo, based on the goal name */ public String getId() { return getPluginDescriptor().getId() + ":" + getGoal(); }
/** * @return the id of the mojo, based on the goal name */ public String getId() { return getPluginDescriptor().getId() + ":" + getGoal(); }