String getRepositoryKey( ArtifactRepository repository )
{
StringBuilder buffer = new StringBuilder( 256 );
// consider the username&password because a repo manager might block artifacts depending on authorization
Authentication auth = repository.getAuthentication();
if ( auth != null )
{
int hash = ( auth.getUsername() + auth.getPassword() ).hashCode();
buffer.append( hash ).append( '@' );
}
// consider the URL (instead of the id) as this most closely relates to the contents in the repo
buffer.append( repository.getUrl() );