Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes Issue #34 by adding a default settings.xml in src/main/resource…

…s and using that as a fallback
  • Loading branch information...
commit ffca8578f48bd65b4b784b00d9f481f7eaa5c82c 1 parent 4bfe8e1
@christopherlakey christopherlakey authored
View
14 maven/src/main/java/com/redhat/ceylon/cmr/maven/AetherUtils.java
@@ -75,35 +75,35 @@ File findDependency(Node node) {
}
}
- private static File getMavenSettings() {
+ private static String getMavenSettings() {
String path = System.getProperty("maven.repo.local");
if (path != null) {
File file = new File(path, "settings.xml");
if (file.exists())
- return file;
+ return file.getPath();
}
path = System.getProperty("user.home");
if (path != null) {
File file = new File(path, ".m2/settings.xml");
if (file.exists())
- return file;
+ return file.getPath();
}
path = System.getenv("M2_HOME");
if (path != null) {
File file = new File(path, "conf/settings.xml");
if (file.exists())
- return file;
+ return file.getPath();
}
- throw new IllegalArgumentException("No known default path to Maven settings.xml!");
+ return "classpath:settings.xml";
}
private static MavenDependencyResolver getResolver() {
if (resolver == null) {
- final File settingsXml = getMavenSettings();
- resolver = DependencyResolvers.use(MavenDependencyResolver.class).configureFrom(settingsXml.getPath());
+ final String settingsXml = getMavenSettings();
+ resolver = DependencyResolvers.use(MavenDependencyResolver.class).configureFrom(settingsXml);
}
return resolver;
}
View
15 maven/src/main/resources/settings.xml
@@ -0,0 +1,15 @@
+<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
+ http://maven.apache.org/xsd/settings-1.0.0.xsd">
+ <localRepository/>
+ <interactiveMode/>
+ <usePluginRegistry/>
+ <offline/>
+ <pluginGroups/>
+ <servers/>
+ <mirrors/>
+ <proxies/>
+ <profiles/>
+ <activeProfiles/>
+</settings>
Please sign in to comment.
Something went wrong with that request. Please try again.