Skip to content

Commit

Permalink
fix typo loading the maven wagon alternatives
Browse files Browse the repository at this point in the history
  • Loading branch information
haubi committed Feb 23, 2024
1 parent 4116074 commit f92b286
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -523,22 +523,26 @@ public Wagon lookup(String roleHint) throws Exception {
return new FileWagon();
case "http":
return newOfFirstWagonAvailable(
"org.apache.maven.wagon.providers.http.HttpWagon.HttpWagon", // since Eclipse 2023-12
"io.takari.aether.wagon.OkHttpWagon.OkHttpWagon");
// since Eclipse 2023-12
"org.apache.maven.wagon.providers.http.HttpWagon",
// up to Eclipse 2023-09
"io.takari.aether.wagon.OkHttpWagon");
case "https":
return newOfFirstWagonAvailable(
"org.apache.maven.wagon.providers.http.HttpWagon.HttpWagon", // since Eclipse 2023-12
"io.takari.aether.wagon.OkHttpWagon.OkHttpsWagon");
// since Eclipse 2023-12
"org.apache.maven.wagon.providers.http.HttpWagon",
// up to Eclipse 2023-09
"io.takari.aether.wagon.OkHttpsWagon");
default:
return null;
}
}

@SuppressWarnings("unchecked")
private static Wagon newOfFirstWagonAvailable(String...classnames)
private static Wagon newOfFirstWagonAvailable(String... classnames)
throws ClassNotFoundException, InstantiationException, IllegalAccessException {
Class<? extends Wagon> clazz = null;
for(String name: classnames) {
for (String name : classnames) {
try {
Class<?> candidate = Class.forName(name);
if (Wagon.class.isAssignableFrom(candidate)) {
Expand Down

0 comments on commit f92b286

Please sign in to comment.