/** * Base configuration for a Karaf container running the specified Ignite features. * * @return The configuration. */ public Option[] baseConfig() { return options( // Specify which version of Karaf to use. karafDistributionConfiguration() .frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("tar.gz") .versionAsInProject()) .karafVersion(System.getProperty("karafVersion")) .useDeployFolder(false) .unpackDirectory(new File("target/paxexam/unpack")), // Add JUnit bundles. junitBundles(), // Add the additional JRE exports that Ignite requires. editConfigurationFileExtend("etc/jre.properties", "jre-1.7", "sun.nio.ch"), editConfigurationFileExtend("etc/jre.properties", "jre-1.8", "sun.nio.ch"), // Make log level INFO. logLevel(LogLevelOption.LogLevel.INFO), // Add our features repository. features(mavenBundle() .groupId("org.apache.ignite").artifactId("ignite-osgi-karaf") .version(System.getProperty("projectVersion")).type("xml/features"), featuresToInstall().toArray(new String[0])), // Propagate the projectVersion system property. systemProperty("projectVersion").value(System.getProperty("projectVersion")) ); }
private static MavenArtifactProvisionOption convertToMaven(String location) { String[] p = location.split("/"); if (p.length >= 4 && p[p.length-1].startsWith(p[p.length-3] + "-" + p[p.length-2])) { MavenArtifactProvisionOption opt = new MavenArtifactProvisionOption(); int artifactIdVersionLength = p[p.length-3].length() + 1 + p[p.length-2].length(); // (artifactId + "-" + version).length if (p[p.length-1].charAt(artifactIdVersionLength) == '-') { opt.classifier((p[p.length-1].substring(artifactIdVersionLength + 1, p[p.length-1].lastIndexOf('.')))); } StringBuffer sb = new StringBuffer(); for (int j = 0; j < p.length - 3; j++) { if (j > 0) { sb.append('.'); } sb.append(p[j]); } opt.groupId(sb.toString()); opt.artifactId(p[p.length-3]); opt.version(p[p.length-2]); opt.type(p[p.length-1].substring(p[p.length-1].lastIndexOf('.') + 1)); return opt; } else { throw new IllegalArgumentException("Unable to extract maven information from " + location); } }
private static MavenArtifactProvisionOption convertToMaven(String location) { String[] p = location.split("/"); if (p.length >= 4 && p[p.length-1].startsWith(p[p.length-3] + "-" + p[p.length-2])) { MavenArtifactProvisionOption opt = new MavenArtifactProvisionOption(); int artifactIdVersionLength = p[p.length-3].length() + 1 + p[p.length-2].length(); // (artifactId + "-" + version).length if (p[p.length-1].charAt(artifactIdVersionLength) == '-') { opt.classifier((p[p.length-1].substring(artifactIdVersionLength + 1, p[p.length-1].lastIndexOf('.')))); } StringBuffer sb = new StringBuffer(); for (int j = 0; j < p.length - 3; j++) { if (j > 0) { sb.append('.'); } sb.append(p[j]); } opt.groupId(sb.toString()); opt.artifactId(p[p.length-3]); opt.version(p[p.length-2]); opt.type(p[p.length-1].substring(p[p.length-1].lastIndexOf('.') + 1)); return opt; } else { throw new IllegalArgumentException("Unable to extract maven information from " + location); } }
public static UrlReference getCamelKarafFeatureUrl() { return mavenBundle(). groupId("org.apache.camel.karaf"). artifactId("apache-camel"). version(getCamelKarafFeatureVersion()). type("xml/features"); }
bundle.artifactId(artifactId); if (type != null) bundle.type(type); if (classifier != null && !"".equals(classifier)) bundle.classifier(classifier);
public static UrlReference getArtemisMQKarafFeatureUrl() { String type = "xml/features"; UrlReference urlReference = mavenBundle().groupId("org.apache.activemq"). artifactId("artemis-features").versionAsInProject().type(type); LOG.info("FeatureURL: " + urlReference.getURL()); return urlReference; }
mavenBundle().groupId("org.ops4j.pax.url") .artifactId("pax-url-war") .type("jar") .classifier("uber") .version(asInProject())