public static Dependency parseDependency(String dependency) {
        List<String> dependencyAndExclusions = Arrays.asList(dependency.split("\\^"));
        Collection<Exclusion> exclusions = new ArrayList<>();
        for (int idx = 1 ; idx < dependencyAndExclusions.size() ; idx++) {
            exclusions.add(AetherUtils.createExclusion(dependencyAndExclusions.get(idx)));
        }

        Artifact artifact = new DefaultArtifact(dependencyAndExclusions.get(0));
        return new Dependency(artifact, JavaScopes.COMPILE, false, exclusions);
    }
@Test
    public void parseDependency() {
        String testDependency = "testgroup:testartifact:1.0.0^testgroup:testexcartifact^testgroup:*";

        Dependency dependency = AetherUtils.parseDependency(testDependency);

        assertEquals("testgroup", dependency.getArtifact().getGroupId());
        assertEquals("testartifact", dependency.getArtifact().getArtifactId());
        assertEquals("1.0.0", dependency.getArtifact().getVersion());
        assertEquals(JavaScopes.COMPILE, dependency.getScope());

        assertEquals(2, dependency.getExclusions().size());

        List<Exclusion> exclusions = Lists.newArrayList(dependency.getExclusions());

        Exclusion exclusion = exclusions.get(0);
        assertEquals("testgroup", exclusion.getGroupId());
        assertEquals("testexcartifact", exclusion.getArtifactId());
        assertEquals(JavaScopes.COMPILE, dependency.getScope());

        exclusion = exclusions.get(1);
        assertEquals("testgroup", exclusion.getGroupId());
        assertEquals("*", exclusion.getArtifactId());
        assertEquals(JavaScopes.COMPILE, dependency.getScope());
    }