o Accounted for refactoring of aether-api

This commit is contained in:
Benjamin Bentmann 2012-01-15 18:36:21 +01:00
parent 8cf8d36777
commit 298403bed3
2 changed files with 28 additions and 17 deletions

View File

@ -23,6 +23,8 @@ import java.io.File;
import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
import java.util.Collections;
import java.util.Map;
import org.apache.maven.artifact.repository.metadata.Metadata;
import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader;
@ -32,12 +34,14 @@ import org.codehaus.plexus.util.ReaderFactory;
import org.codehaus.plexus.util.WriterFactory;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import org.eclipse.aether.RepositoryException;
import org.eclipse.aether.metadata.AbstractMetadata;
import org.eclipse.aether.metadata.MergeableMetadata;
/**
* @author Benjamin Bentmann
*/
abstract class MavenMetadata
extends AbstractMetadata
implements MergeableMetadata
{
@ -130,24 +134,15 @@ abstract class MavenMetadata
}
}
@Override
public String toString()
public Map<String, String> getProperties()
{
StringBuilder buffer = new StringBuilder( 128 );
if ( getGroupId().length() > 0 )
{
buffer.append( getGroupId() );
}
if ( getArtifactId().length() > 0 )
{
buffer.append( ':' ).append( getArtifactId() );
}
if ( getVersion().length() > 0 )
{
buffer.append( ':' ).append( getVersion() );
}
buffer.append( '/' ).append( getType() );
return buffer.toString();
return Collections.emptyMap();
}
@Override
public org.eclipse.aether.metadata.Metadata setProperties( Map<String, String> properties )
{
return this;
}
}

View File

@ -20,6 +20,8 @@ package org.apache.maven.artifact.repository.metadata;
*/
import java.io.File;
import java.util.Collections;
import java.util.Map;
import org.apache.maven.artifact.metadata.ArtifactMetadata;
import org.apache.maven.artifact.repository.ArtifactRepository;
@ -27,7 +29,9 @@ import org.apache.maven.artifact.repository.DefaultArtifactRepository;
import org.apache.maven.artifact.repository.metadata.RepositoryMetadata;
import org.codehaus.plexus.util.FileUtils;
import org.eclipse.aether.RepositoryException;
import org.eclipse.aether.metadata.AbstractMetadata;
import org.eclipse.aether.metadata.MergeableMetadata;
import org.eclipse.aether.metadata.Metadata;
/**
* <strong>Warning:</strong> This is an internal utility class that is only public for technical reasons, it is not part
@ -36,6 +40,7 @@ import org.eclipse.aether.metadata.MergeableMetadata;
* @author Benjamin Bentmann
*/
public final class MetadataBridge
extends AbstractMetadata
implements MergeableMetadata
{
@ -127,6 +132,17 @@ public final class MetadataBridge
}
}
public Map<String, String> getProperties()
{
return Collections.emptyMap();
}
@Override
public Metadata setProperties( Map<String, String> properties )
{
return this;
}
@SuppressWarnings( "deprecation" )
static class MetadataRepository
extends DefaultArtifactRepository