diff options
author | LexManos <LexManos@gmail.com> | 2018-11-07 16:09:09 -0800 |
---|---|---|
committer | LexManos <LexManos@gmail.com> | 2018-11-07 16:09:09 -0800 |
commit | 37d713bdb7459cdd44707b350fd12fd59517b415 (patch) | |
tree | 6d500b4c8c040ab65ff17a51382a6bd2271210c6 /src/gradlecomp/java | |
parent | 564ddae6a4dbc6946092821183708283356c618d (diff) | |
download | Artifactural-37d713bdb7459cdd44707b350fd12fd59517b415.tar.gz Artifactural-37d713bdb7459cdd44707b350fd12fd59517b415.tar.bz2 Artifactural-37d713bdb7459cdd44707b350fd12fd59517b415.zip |
Allow repos to provide maven-metadata.xml files to list known versions.
Diffstat (limited to 'src/gradlecomp/java')
-rw-r--r-- | src/gradlecomp/java/com/amadornes/artifactural/gradle/GradleRepositoryAdapter.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/gradlecomp/java/com/amadornes/artifactural/gradle/GradleRepositoryAdapter.java b/src/gradlecomp/java/com/amadornes/artifactural/gradle/GradleRepositoryAdapter.java index 834905c..64d6652 100644 --- a/src/gradlecomp/java/com/amadornes/artifactural/gradle/GradleRepositoryAdapter.java +++ b/src/gradlecomp/java/com/amadornes/artifactural/gradle/GradleRepositoryAdapter.java @@ -236,9 +236,7 @@ public class GradleRepositoryAdapter extends AbstractArtifactRepository implemen String relative = path.substring(root.length()); debug(" Relative: " + relative); Matcher matcher = URL_PATTERN.matcher(relative); - if (!matcher.matches()) { - log(" Matcher Failed: " + relative); - } else { + if (matcher.matches()) { ArtifactIdentifier identifier = new SimpleArtifactIdentifier( matcher.group("group").replace('/', '.'), matcher.group("name"), @@ -247,6 +245,19 @@ public class GradleRepositoryAdapter extends AbstractArtifactRepository implemen matcher.group("extension")); Artifact artifact = repository.getArtifact(identifier); return wrap(artifact, identifier); + } else if (relative.endsWith("maven-metadata.xml")) { + String tmp = relative.substring(0, relative.length() - "maven-metadata.xml".length() - 1); + int idx = tmp.lastIndexOf('/'); + if (idx != -1) { + File ret = repository.getMavenMetadata(tmp.substring(0, idx - 1), tmp.substring(idx)); + if (ret != null) { + return new LocalFileStandInExternalResource(ret, fileSystem); + } + } + } else if (relative.endsWith("/")) { + debug(" Directory listing not supported"); + } else { + log(" Matcher Failed: " + relative); } } else { log("Unknown root: " + path); |