package io.airlift.resolver.internal.aether;

import com.google.common.collect.ImmutableList;
import org.sonatype.aether.artifact.Artifact;
import org.sonatype.aether.resolution.DependencyResolutionException;
import org.sonatype.aether.util.artifact.DefaultArtifact;
import org.testng.Assert;
import org.testng.annotations.Test;

import java.io.File;
import java.util.List;

import static io.airlift.resolver.ArtifactResolver.MAVEN_CENTRAL_URI;

public class AetherMavenResolverTest
{
    @Test
    public void testResolveArtifacts()
            throws Exception
    {
        AetherMavenResolver aetherMavenResolver = new AetherMavenResolver("target/local-repo", MAVEN_CENTRAL_URI);
        List<Artifact> artifacts = aetherMavenResolver.resolveArtifacts(ImmutableList.of(new DefaultArtifact("org.apache.maven:maven-core:3.0.4")));

        Assert.assertNotNull(artifacts, "artifacts is null");
        for (Artifact artifact : artifacts) {
            Assert.assertNotNull(artifact.getFile(), "Artifact " + artifact + " is not resolved");
        }
    }

    @Test
    public void testResolvePom()
            throws DependencyResolutionException
    {
        File pomFile = new File("src/test/poms/maven-core-3.0.4.pom");
        Assert.assertTrue(pomFile.canRead());

        AetherMavenResolver aetherMavenResolver = new AetherMavenResolver("target/local-repo", MAVEN_CENTRAL_URI);
        List<Artifact> artifacts = aetherMavenResolver.resolvePom(pomFile);

        Assert.assertNotNull(artifacts, "artifacts is null");
        for (Artifact artifact : artifacts) {
            Assert.assertNotNull(artifact.getFile(), "Artifact " + artifact + " is not resolved");
        }
    }
}

@@ -372,117 +372,234 @@
 t;%0A%0A
-import static io.airlift.resolver.ArtifactResolver.MAVEN_CENTRAL_URI;%0A%0Apublic class AetherMavenResolverTest%0A%7B
+public class AetherMavenResolverTest%0A%7B%0A    public static final String USER_LOCAL_REPO = System.getProperty(%22user.home%22) + %22/.m2/repository%22;%0A    public static final String MAVEN_CENTRAL_URI = %22http://repo1.maven.org/maven2/%22;%0A
 %0A   
@@ -753,35 +753,31 @@
 esolver(
-%22target/local-repo%22
+USER_LOCAL_REPO
 , MAVEN_
@@ -1458,27 +1458,23 @@
 ver(
-%22target/local-repo%22
+USER_LOCAL_REPO
 , MA

Remove dependency between AetherMavenResolverTest and ArtifactResolver