@Override public String getLocalizedMessage() { return getMessage(); }
NeoProjectVersionRef( final String groupId, final String artifactId, final VersionSpec versionSpec, final String versionString ) { super( groupId, artifactId ); if ( versionSpec == null && versionString == null ) { throw new InvalidRefException( "Version spec AND string cannot both be null for '" + groupId + ":" + artifactId + "'" ); } this.versionString = versionString; this.versionSpec = versionSpec; }
public void addReportPluginUsages( final URI source, final Builder builder, final MavenPomView pomView, final ProjectVersionRef projectRef ) throws CartoDataException { List<PluginView> plugins = null; try { plugins = pomView.getAllPluginsMatching( "//reporting/plugins/plugin" ); } catch ( final GalleyMavenException e ) { logger.error( String.format( "%s: Cannot retrieve reporting plugins: %s", pomView.getRef(), e.getMessage() ), e ); } catch ( final InvalidVersionSpecificationException e ) { logger.error( String.format( "%s: Cannot retrieve reporting plugins: %s", pomView.getRef(), e.getMessage() ), e ); } catch ( final InvalidRefException e ) { logger.error( String.format( "%s: Cannot retrieve reporting plugins: %s", pomView.getRef(), e.getMessage() ), e ); } addPlugins( plugins, projectRef, builder, source, false ); }
SimpleProjectVersionRef( final String groupId, final String artifactId, final VersionSpec versionSpec, final String versionString ) { super( groupId, artifactId ); if ( versionSpec == null && StringUtils.isEmpty( versionString ) ) { throw new InvalidRefException( "Version spec AND string cannot both be empty for '" + groupId + ":" + artifactId + "'" ); } this.versionString = versionString; this.versionSpec = versionSpec; }
locations, e.getMessage() ), e );
public SimpleProjectRef( final String groupId, final String artifactId ) { if ( isEmpty( groupId ) || isEmpty( artifactId ) ) { throw new InvalidRefException( "ProjectId must contain non-empty groupId AND artifactId. (Given: '" + groupId + "':'" + artifactId + "')" ); } this.groupId = groupId; this.artifactId = artifactId; }
private void addSiteReportPluginUsages( final URI source, final Builder builder, final MavenPomView pomView, final ProjectVersionRef projectRef ) throws CartoDataException { // final List<ProjectVersionRefView> refs = pomView.getProjectVersionRefs( "//plugin[artifactId/text()=\"maven-site-plugin\"]//reportPlugin" ); List<PluginView> plugins = null; try { plugins = pomView.getAllPluginsMatching( "//plugin[artifactId/text()=\"maven-site-plugin\"]//reportPlugin" ); } catch ( final InvalidRefException e ) { logger.error( String.format( "%s: Cannot retrieve site-plugin nested reporting plugins: %s", pomView.getRef(), e.getMessage() ), e ); } catch ( final InvalidVersionSpecificationException e ) { logger.error( String.format( "%s: Cannot retrieve site-plugin nested reporting plugins: %s", pomView.getRef(), e.getMessage() ), e ); } catch ( final GalleyMavenException e ) { logger.error( String.format( "%s: Cannot retrieve site-plugin nested reporting plugins: %s", pomView.getRef(), e.getMessage() ), e ); } addPlugins( plugins, projectRef, builder, source, false ); }
public static ProjectVersionRef parse( final String gav ) { final String[] parts = gav.split( ":" ); if ( parts.length < 3 || isEmpty( parts[0] ) || isEmpty( parts[1] ) || isEmpty( parts[2] ) ) { throw new InvalidRefException( "ProjectVersionRef must contain non-empty groupId, artifactId, AND version. (Given: '" + gav + "')" ); } return new SimpleProjectVersionRef( parts[0], parts[1], parts[2] ); }
locations, e.getMessage() ), e );
public static ProjectVersionRef parse( final String gav ) { final String[] parts = gav.split( ":" ); if ( parts.length < 3 || isEmpty( parts[0] ) || isEmpty( parts[1] ) || isEmpty( parts[2] ) ) { throw new InvalidRefException( "ProjectVersionRef must contain non-empty groupId, artifactId, AND version. (Given: '" + gav + "')" ); } return new NeoProjectVersionRef( parts[0], parts[1], parts[2] ); }
e.getMessage() ), e ); logger.error( String.format( "%s: Cannot retrieve build plugins: %s", pomView.getRef(), e.getMessage() ), e );
public static ProjectRef parse( final String ga ) { final String[] parts = ga.split( ":" ); if ( parts.length < 2 || isEmpty( parts[0] ) || isEmpty( parts[1] ) ) { throw new InvalidRefException( "ProjectRef must contain non-empty groupId AND artifactId. (Given: '" + ga + "')" ); } return new SimpleProjectRef( parts[0], parts[1] ); }
public static ProjectRef parse( final String ga ) { final String[] parts = ga.split( ":" ); if ( parts.length < 2 || isEmpty( parts[0] ) || isEmpty( parts[1] ) ) { throw new InvalidRefException( "ProjectRef must contain non-empty groupId AND artifactId. (Given: '" + ga + "')" ); } return new NeoProjectRef( parts[0], parts[1] ); }
locations, e.getMessage() ), e );
public static String getStringProperty( final PropertyContainer container, final String named, final String memVal ) { if ( memVal != null ) { return memVal; } String v = container == null ? null : Conversions.getStringProperty( named, container ); if ( v == null ) { throw new InvalidRefException( named + " cannot both be null!" ); } return v; }
locations, e.getMessage() ), e );
public NeoProjectRef( final String groupId, final String artifactId ) { this.groupId = groupId; this.artifactId = artifactId; if ( isEmpty( getGroupId() ) || isEmpty( getArtifactId() ) ) { throw new InvalidRefException( "ProjectId must contain non-empty groupId AND artifactId. (Given: '" + groupId + "':'" + artifactId + "')" ); } }
e.getMessage() ), e ); pomView.getRef(), e.getMessage(), bomView.toXML() ), e ); pomView.getRef(), e.getMessage() ), e ); e.getMessage() ), e );
public static NeoArtifactRef parse( final String spec ) { final String[] parts = spec.split( ":" ); if ( parts.length < 3 || isEmpty( parts[0] ) || isEmpty( parts[1] ) || isEmpty( parts[2] ) ) { throw new InvalidRefException( "SimpleArtifactRef must contain AT LEAST non-empty groupId, artifactId, AND version. (Given: '" + spec + "')" ); } final String g = parts[0]; final String a = parts[1]; // assume we're actually parsing a GAV into a POM artifact... String v = parts[2]; String t = "pom"; String c = null; if ( parts.length > 3 ) { // oops, it's a type, not a version...see toString() for the specification. t = v; v = parts[3]; if ( parts.length > 4 ) { c = parts[4]; } } // assume non-optional, because it might not matter if you're parsing a string like this...you'd be more careful if you were reading something // that had an optional field, because it's not in the normal GATV[C] spec. return new NeoArtifactRef( g, a, v, t, c ); }