Permalink
Browse files

Use the right classloader.

  • Loading branch information...
1 parent 38d68f7 commit 0bd4877aa33544502c67d40ec17acc0e8c2c636e @alesj alesj committed Mar 7, 2013
Showing with 9 additions and 3 deletions.
  1. +9 −3 maven/src/main/java/com/redhat/ceylon/cmr/maven/AetherUtils.java
View
12 maven/src/main/java/com/redhat/ceylon/cmr/maven/AetherUtils.java
@@ -28,8 +28,10 @@
import com.redhat.ceylon.cmr.api.RepositoryException;
import com.redhat.ceylon.cmr.impl.AbstractArtifactResult;
import com.redhat.ceylon.cmr.spi.Node;
+import org.jboss.shrinkwrap.resolver.api.ConfiguredResolverSystemFactory;
import org.jboss.shrinkwrap.resolver.api.ResolutionException;
-import org.jboss.shrinkwrap.resolver.api.maven.Maven;
+import org.jboss.shrinkwrap.resolver.api.Resolvers;
+import org.jboss.shrinkwrap.resolver.api.maven.ConfigurableMavenResolverSystem;
import org.jboss.shrinkwrap.resolver.api.maven.MavenArtifactInfo;
import org.jboss.shrinkwrap.resolver.api.maven.MavenFormatStage;
import org.jboss.shrinkwrap.resolver.api.maven.MavenResolvedArtifact;
@@ -167,9 +169,13 @@ public static String getDefaultMavenSettings() {
}
private MavenResolverSystem getResolver() {
+ ClassLoader classLoader = AetherUtils.class.getClassLoader();
+ ConfiguredResolverSystemFactory<MavenResolverSystem, ConfigurableMavenResolverSystem> factory = Resolvers.configure(ConfigurableMavenResolverSystem.class, classLoader);
+
if (settingsXml.startsWith("classpath:"))
- return Maven.configureResolver().fromClassloaderResource(settingsXml.substring(10));
- return Maven.configureResolver().fromFile(settingsXml);
+ return factory.fromClassloaderResource(settingsXml.substring(10));
+
+ return factory.fromFile(settingsXml);
}
private static abstract class MavenArtifactResult extends AbstractArtifactResult {

0 comments on commit 0bd4877

Please sign in to comment.