Skip to content

Commit

Permalink
Reworked the patch by Eric Barboni.
Browse files Browse the repository at this point in the history
The patch by Eric Barboni gathers maven archives from archive.apache.org
in both old and new directory layout. This patch, as suggested by David
J. M. Karlsen gathers archives only from maven central.
  • Loading branch information
Zoran Regvart committed Feb 5, 2015
1 parent ea8e896 commit 23c0346
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ant_maven.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def altListUp(url,pattern) {
if(m.find() ) {
l=a.hrefAttribute.length()-2;
ver=a.hrefAttribute.getAt(0..l);
url = p.getFullyQualifiedUrl(a.hrefAttribute+"binaries/");
url = p.getFullyQualifiedUrl(a.hrefAttribute);
HtmlPage pb = wc.getPage(url);
return pb.getAnchors().collect { HtmlAnchor a1 ->
n = pattern.matcher(a1.hrefAttribute)
Expand All @@ -86,6 +86,4 @@ def store(key,o) {
}

store("hudson.tasks.Ant.AntInstaller", listUp("http://archive.apache.org/dist/ant/binaries/", "ant-([0-9.]+)-bin.zip\$").sort ( sortingversion ))
store("hudson.tasks.Maven.MavenInstaller", listUp("http://archive.apache.org/dist/maven/binaries/","maven-([0-9.]+)(-bin)?.zip\$").plus(altListUp("http://archive.apache.org/dist/maven/maven-3/","maven-([0-9.]+)(-bin)?.zip\$")).unique(false) {
a ,b -> a.id <=> b.id
}.sort(sortingversion))
store("hudson.tasks.Maven.MavenInstaller", altListUp("http://repo1.maven.org/maven2/org/apache/maven/apache-maven/","maven-([0-9.]+)(-bin)?.zip\$").sort(sortingversion))

0 comments on commit 23c0346

Please sign in to comment.