/** * Try to resolve a Maven JAR artifact. Calling this method is identical to calling * {@code resolveJarArtifact(qualifier, "jar")}. * * @param coordinates the non-{@code null} Maven coordinates object * @return the absolute path to the artifact, or {@code null} if none exists * @throws IOException if acquiring the artifact path failed for some reason */ default File resolveJarArtifact(final ArtifactCoordinates coordinates) throws IOException { return resolveArtifact(coordinates, "jar"); }
@Override public File resolveArtifact(ArtifactCoordinates coordinates, String packaging) throws IOException { for (MavenResolver resolver : this.resolvers) { File result = resolver.resolveArtifact(coordinates, packaging); if (result != null) { return result; } } return null; } }
@Override public File resolveArtifact(ArtifactCoordinates coordinates, String packaging) throws IOException { try (AutoCloseable handle = Performance.accumulate("artifact-resolver")) { for (MavenResolver resolver : this.resolvers) { File result = resolver.resolveArtifact(coordinates, packaging); if (result != null) { return result; } } return null; } catch (Exception e) { throw new RuntimeException(e); } }
return MavenResolvers.get().resolveArtifact( new ArtifactCoordinates( groupId,
return MavenResolvers.get().resolveArtifact( new ArtifactCoordinates( groupId,
classifier == null ? "" : classifier); return MavenResolvers.get().resolveArtifact(coords, packaging);
classifier == null ? "" : classifier); return MavenResolvers.get().resolveArtifact(coords, packaging);
classifier == null ? "" : classifier); return MavenResolvers.get().resolveArtifact(coords, packaging);