private String toProjectKey( ArchivaProjectModel project ) { StringBuilder key = new StringBuilder(); key.append( project.getGroupId() ).append( ":" ); key.append( project.getArtifactId() ).append( ":" ); key.append( project.getVersion() ); return key.toString(); } }
private void appendModel( StringBuffer buf, ArchivaProjectModel model ) { buf.append( "groupId:" ).append( model.getGroupId() ); buf.append( "|artifactId:" ).append( model.getArtifactId() ); buf.append( "|version:" ).append( model.getVersion() ); buf.append( "|packaging:" ).append( model.getPackaging() ); }
private String toProjectKey( ArchivaProjectModel project ) { StringBuilder key = new StringBuilder(); key.append( project.getGroupId() ).append( ":" ); key.append( project.getArtifactId() ).append( ":" ); key.append( project.getVersion() ); return key.toString(); }
private void appendModel( StringBuffer buf, ArchivaProjectModel model ) { buf.append( "groupId:" ).append( model.getGroupId() ); buf.append( "|artifactId:" ).append( model.getArtifactId() ); buf.append( "|version:" ).append( model.getVersion() ); buf.append( "|packaging:" ).append( model.getPackaging() ); }
/** * Method toString */ public java.lang.String toString() { StringBuffer buf = new StringBuffer(); buf.append( "groupId = '" ); buf.append( getGroupId() + "'" ); buf.append( "\n" ); buf.append( "artifactId = '" ); buf.append( getArtifactId() + "'" ); buf.append( "\n" ); buf.append( "version = '" ); buf.append( getVersion() + "'" ); return buf.toString(); } //-- java.lang.String toString()
/** * Method equals * * @param other */ public boolean equals(Object other) { if ( this == other) { return true; } if ( !(other instanceof ArchivaProjectModel) ) { return false; } ArchivaProjectModel that = (ArchivaProjectModel) other; boolean result = true; result = result && ( getGroupId() == null ? that.getGroupId() == null : getGroupId().equals( that.getGroupId() ) ); result = result && ( getArtifactId() == null ? that.getArtifactId() == null : getArtifactId().equals( that.getArtifactId() ) ); result = result && ( getVersion() == null ? that.getVersion() == null : getVersion().equals( that.getVersion() ) ); return result; } //-- boolean equals(Object)
if ( !artifact.getArtifactId().equalsIgnoreCase( model.getArtifactId() ) ) emsg.append( " has an invalid project model [" ); appendModel( emsg, model ); emsg.append( "]: The model artifactId [" ).append( model.getArtifactId() ); emsg.append( "] does not match the artifactId portion of the filename: " ).append( artifact.getArtifactId() );
public static String toKey( ArchivaProjectModel model ) { return toKey( model.getGroupId(), model.getArtifactId(), model.getVersion() ); }
if ( !artifact.getArtifactId().equalsIgnoreCase( model.getArtifactId() ) ) emsg.append( " has an invalid project model [" ); appendModel( emsg, model ); emsg.append( "]: The model artifactId [" ).append( model.getArtifactId() ); emsg.append( "] does not match the artifactId portion of the filename: " ).append( artifact.getArtifactId() );
private void validateAppropriateModel( String location, ArchivaArtifact artifact, ArchivaProjectModel model ) throws ConsumerException { if ( model != null ) { if ( !StringUtils.equals( model.getGroupId(), artifact.getGroupId() ) ) { addProblem( artifact, "The groupId of the " + location + " project model doesn't match with the artifact, expected <" + artifact.getGroupId() + ">, but was actually <" + model.getGroupId() + ">" ); } if ( !StringUtils.equals( model.getArtifactId(), artifact.getArtifactId() ) ) { addProblem( artifact, "The artifactId of the " + location + " project model doesn't match with the artifact, expected <" + artifact.getArtifactId() + ">, but was actually <" + model.getArtifactId() + ">" ); } if ( !StringUtils.equals( model.getVersion(), artifact.getVersion() ) ) { addProblem( artifact, "The version of the " + location + " project model doesn't match with the artifact, expected <" + artifact.getVersion() + ">, but was actually <" + model.getVersion() + ">" ); } } }
public static ArchivaProjectModel clone( ArchivaProjectModel model ) { if ( model == null ) { return null; } ArchivaProjectModel cloned = new ArchivaProjectModel(); cloned.setGroupId( model.getGroupId() ); cloned.setArtifactId( model.getArtifactId() ); cloned.setVersion( model.getVersion() ); cloned.setParentProject( clone( model.getParentProject() ) ); cloned.setName( model.getName() ); cloned.setDescription( model.getDescription() ); cloned.setUrl( model.getUrl() ); cloned.setPackaging( model.getPackaging() ); cloned.setOrigin( model.getOrigin() ); cloned.setMailingLists( cloneMailingLists( model.getMailingLists() ) ); cloned.setCiManagement( clone( model.getCiManagement() ) ); cloned.setIndividuals( cloneIndividuals( model.getIndividuals() ) ); cloned.setIssueManagement( clone( model.getIssueManagement() ) ); cloned.setLicenses( cloneLicenses( model.getLicenses() ) ); cloned.setOrganization( clone( model.getOrganization() ) ); cloned.setScm( clone( model.getScm() ) ); cloned.setRepositories( cloneRepositories( model.getRepositories() ) ); cloned.setDependencies( cloneDependencies( model.getDependencies() ) ); cloned.setPlugins( clonePlugins( model.getPlugins() ) ); cloned.setReports( cloneReports( model.getReports() ) ); cloned.setDependencyManagement( cloneDependencies( model.getDependencyManagement() ) ); return cloned; }