GradleResolver implements MavenResolver { String toGradleArtifactPath(ArtifactCoordinates artifactCoordinates) { String pathWithMissingClassifier = artifactCoordinates.relativeArtifactPath('/'); StringBuilder sb = new StringBuilder(pathWithMissingClassifier); if (artifactCoordinates.getClassifier() != null && artifactCoordinates.getClassifier().length() > 0) { sb .append("-") .append(artifactCoordinates.getClassifier()); } return sb.toString(); } GradleResolver(String gradleCachePath); @Override File resolveArtifact(ArtifactCoordinates artifactCoordinates, String packaging);  }
@Test public void testToGradleArtifactPath(){ String group = "org.jboss.ws.cxf"; String artifact = "jbossws-cxf-resources"; String version = "5.1.5.Final"; ArtifactCoordinates artifactCoordinates = new ArtifactCoordinates(group, artifact, version); GradleResolver resolver = new GradleResolver(null); String artifactPath = resolver.toGradleArtifactPath(artifactCoordinates); assertEquals( "org/jboss/ws/cxf/jbossws-cxf-resources/5.1.5.Final/jbossws-cxf-resources-5.1.5.Final", artifactPath); }
@Test public void testToGradleArtifactPath_withClassifier(){ String group = "org.jboss.ws.cxf"; String artifact = "jbossws-cxf-resources"; String version = "5.1.5.Final"; String classifier = "wildfly1000"; ArtifactCoordinates artifactCoordinates = new ArtifactCoordinates(group, artifact, version, classifier); GradleResolver resolver = new GradleResolver(null); String artifactPath = resolver.toGradleArtifactPath(artifactCoordinates); assertEquals( "org/jboss/ws/cxf/jbossws-cxf-resources/5.1.5.Final/jbossws-cxf-resources-5.1.5.Final-wildfly1000", artifactPath); }