use of org.ops4j.util.property.PropertiesPropertyResolver in project fabric8 by jboss-fuse.
the class AetherResolutionWithHintsTest method mavenConfiguration.
private MavenConfigurationImpl mavenConfiguration() {
Properties properties = new Properties();
properties.setProperty("pid.localRepository", "target/" + UUID.randomUUID().toString());
properties.setProperty("pid.globalChecksumPolicy", "ignore");
properties.setProperty("pid.timeout", "1000");
properties.setProperty("pid.connection.retryCount", "0");
return new MavenConfigurationImpl(new PropertiesPropertyResolver(properties), "pid");
}
use of org.ops4j.util.property.PropertiesPropertyResolver in project fabric8 by jboss-fuse.
the class MavenResolvers method createMavenResolver.
public static MavenResolver createMavenResolver(Mirror mirror, Dictionary<String, String> properties, String pid, RepositorySystem repositorySystem) {
PropertiesPropertyResolver syspropsResolver = new PropertiesPropertyResolver(System.getProperties());
DictionaryPropertyResolver propertyResolver = new DictionaryPropertyResolver(properties, syspropsResolver);
MavenConfigurationImpl config = new MavenConfigurationImpl(propertyResolver, pid);
return new AetherBasedResolver(config, mirror, repositorySystem);
}
use of org.ops4j.util.property.PropertiesPropertyResolver in project fabric8 by jboss-fuse.
the class Log4jLogQuery method loadCoords.
protected String loadCoords(String coords, String filePath, String classifier) throws IOException {
String[] split = coords.split("/");
if (split != null && split.length > 2) {
String groupId = split[0];
String artifactId = split[1];
String version = split[2];
if (resolver == null) {
Properties defaultProperties = getDefaultProperties();
Properties systemProperties = System.getProperties();
if (config == null) {
Properties combined = new Properties();
combined.putAll(defaultProperties);
combined.putAll(systemProperties);
if (properties != null) {
combined.putAll(properties);
}
config = new MavenConfigurationImpl(new PropertiesPropertyResolver(combined), ServiceConstants.PID);
}
resolver = new AetherBasedResolver(config);
}
File file = resolver.resolveFile(groupId, artifactId, classifier, "jar", version);
if (file.exists() && file.isFile()) {
if (isRoot(filePath)) {
return jarIndex(file);
}
String fileUri = file.toURI().toString();
URL url = new URL("jar:" + fileUri + "!" + filePath);
return loadString(url);
}
}
return null;
}
use of org.ops4j.util.property.PropertiesPropertyResolver in project fabric8 by jboss-fuse.
the class AetherTimeoutTest method basicMavenConfiguration.
private MavenConfigurationImpl basicMavenConfiguration(int timeoutInMs) {
Properties properties = new Properties();
properties.setProperty("pid.localRepository", "target/" + UUID.randomUUID().toString());
properties.setProperty("pid.timeout", Integer.toString(timeoutInMs));
properties.setProperty("pid.globalChecksumPolicy", "ignore");
properties.setProperty("pid.connection.retryCount", "0");
return new MavenConfigurationImpl(new PropertiesPropertyResolver(properties), "pid");
}
use of org.ops4j.util.property.PropertiesPropertyResolver in project fabric8 by jboss-fuse.
the class AetherTimeoutTest method basicMavenConfigurationWithTwoTimeouts.
private MavenConfigurationImpl basicMavenConfigurationWithTwoTimeouts(int readTimeoutInMs, int connectTimeoutInMs) {
Properties properties = new Properties();
properties.setProperty("pid.localRepository", "target/" + UUID.randomUUID().toString());
properties.setProperty("pid.timeout", Integer.toString(readTimeoutInMs));
properties.setProperty("pid.socket.connectionTimeout", Integer.toString(connectTimeoutInMs));
properties.setProperty("pid.globalChecksumPolicy", "ignore");
properties.setProperty("pid.connection.retryCount", "0");
return new MavenConfigurationImpl(new PropertiesPropertyResolver(properties), "pid");
}
Aggregations