public static String toKey( ProjectReference reference ) { StringBuffer key = new StringBuffer(); key.append( defaultString( reference.getGroupId() ) ).append( ":" ); key.append( defaultString( reference.getArtifactId() ) ).append( ":" ); return key.toString(); }
public static String toKey( ProjectReference ref ) { StringBuffer key = new StringBuffer(); key.append( ref.getGroupId() ).append( ":" ); key.append( ref.getArtifactId() ); return key.toString(); }
ProjectReference reference = new ProjectReference(); reference.setGroupId( artifact.getGroupId() ); reference.setArtifactId( artifact.getArtifactId() );
public Set<String> getVersions( ProjectReference reference ) throws ContentNotFoundException File groupDir = new File( repository.getLocation(), reference.getGroupId() );
private void getProjectVersions( File typeDir, ProjectReference reference, Set<String> foundVersions ) { File repoFiles[] = typeDir.listFiles(); for ( File repoFile : repoFiles ) { if ( repoFile.isDirectory() ) { // Skip it. it's a directory. continue; } String relativePath = PathUtil.getRelative( repository.getLocation(), repoFile ); if ( filetypes.matchesArtifactPattern( relativePath ) ) { try { ArtifactReference artifact = toArtifactReference( relativePath ); if ( StringUtils.equals( artifact.getArtifactId(), reference.getArtifactId() ) ) { foundVersions.add( artifact.getVersion() ); } } catch ( LayoutException e ) { /* don't fail the process if there is a bad artifact within the directory. */ } } } }
public String toMetadataPath( ProjectReference reference ) { StringBuffer path = new StringBuffer(); path.append( formatAsDirectory( reference.getGroupId() ) ).append( PATH_SEPARATOR ); path.append( reference.getArtifactId() ).append( PATH_SEPARATOR ); path.append( MAVEN_METADATA ); return path.toString(); }
versionRef.setGroupId( reference.getGroupId() ); versionRef.setArtifactId( reference.getArtifactId() );