/** * Felix remote shell bundles * @return Composite option */ public static CompositeOption felixRemoteShellBundles() { final String gogoVersion = "0.10.0"; return new DefaultCompositeOption( mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.gogo.runtime").version(gogoVersion), mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.gogo.shell").version(gogoVersion), mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.gogo.command").version(gogoVersion), mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.shell.remote").version("1.1.2") ); }
public static MavenArtifactProvisionOption mavenBundle(String groupId, String artifactId) { return CoreOptions.mavenBundle().groupId(groupId).artifactId(artifactId).versionAsInProject(); }
/** * 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")) ); }
public static MavenArtifactProvisionOption mavenBundle(String groupId, String artifactId, String version, String classifier, String type) { MavenArtifactProvisionOption m = CoreOptions.mavenBundle().groupId(groupId).artifactId(artifactId); if (version != null) { m.version(version); } else { try { m.versionAsInProject(); } catch (RuntimeException t) { m.version(version); } else { throw t; m.classifier(classifier); m.type(type);
public String getURL() { if (url == null) { MavenArtifactProvisionOption bundle = new MavenArtifactProvisionOption(); bundle.groupId(groupId); bundle.artifactId(artifactId); if (type != null) bundle.type(type); if (classifier != null && !"".equals(classifier)) bundle.classifier(classifier); if (versionAsInProject) try { logger.error("Could not find version of " + groupId + ":" + artifactId + " in Maven project"); throw new RuntimeException("Could not find version of " + groupId + ":" + artifactId + " in Maven project"); } bundle.version(version); if (startLevel > 0) { bundle.startLevel(startLevel); .getURL(); } else url = bundle.getURL(); } return url;
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); } }
String value = startupProps.getProperty(name); MavenArtifactProvisionOption opt = convertToMaven(name); if (opt.getURL().contains("org.apache.karaf.features")) { opt.noStart(); opt.startLevel(Integer.parseInt(value)); options.add(opt); ((MavenArtifactProvisionOption) jubo.getDelegate()).groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.junit").version("4.7_1"); options.add(jubo); return options.toArray(new Option[options.size()]);
/** * Return the options required by this container implementation. * * @return local options */ private Option[] localOptions() { return new Option[] { // remote bundle context bundle mavenBundle().groupId( "org.ops4j.pax.exam" ).artifactId( "pax-exam-container-rbc" ).version( Info.getPaxExamVersion() ).update( Info.isPaxExamSnapshotVersion() ).startLevel( START_LEVEL_SYSTEM_BUNDLES ), // rmi communication port systemProperty( Constants.RMI_PORT_PROPERTY ).value( m_remoteBundleContextClient.getRmiPort().toString() ), // boot delegation for sun.*. This seems only necessary in Knopflerfish version > 2.0.0 bootDelegationPackage( "sun.*" ) }; }
mavenBundle().groupId("javax.websocket") .artifactId("javax.websocket-api").version(asInProject()), mavenBundle().groupId("org.ops4j.pax.web.itest") .artifactId("pax-web-itest-base").versionAsInProject(), mavenBundle().groupId("org.apache.httpcomponents").artifactId("httpcore-osgi").versionAsInProject(), mavenBundle().groupId("org.apache.httpcomponents").artifactId("httpclient-osgi").versionAsInProject(), mavenBundle().groupId("org.apache.httpcomponents").artifactId("httpasyncclient-osgi").versionAsInProject() );
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; }
/** * Sets the junit version. * * @param version * junit version. * * @return itself, for fluent api usage */ public JUnitBundlesOption version(final String version) { ((MavenArtifactProvisionOption) getDelegate()).version(version); return this; }
public Option ogemaWebFrontentOption() { return CoreOptions.composite( // CoreOptions.mavenBundle("de.twentyeleven.skysail", "org.json-osgi", "20080701"), // CoreOptions.mavenBundle("org.json", "json", "20160212"), CoreOptions.mavenBundle("commons-fileupload", "commons-fileupload", "1.3.1"), CoreOptions.mavenBundle("org.ogema.ref-impl", "framework-administration").version(ogemaVersion).start()); // CoreOptions.mavenBundle("commons-codec", "commons-codec").version("1.10").start()); }
public Option[] frameworkBundles() { return new Option[] { CoreOptions.mavenBundle("org.apache.felix", "org.apache.felix.framework.security", "2.6.0").start(), CoreOptions.mavenBundle("org.ogema.ref-impl", "permission-admin").version(ogemaVersion).startLevel(1) .start(), CoreOptions.mavenBundle("org.ow2.asm", "asm-all", "5.2").start(), CoreOptions.mavenBundle("org.apache.felix", "org.apache.felix.scr", "2.1.0").start(), CoreOptions.mavenBundle("org.apache.felix", "org.apache.felix.eventadmin", "1.5.0").start(), CoreOptions.mavenBundle("org.ogema.external", "org.apache.felix.useradmin.filestore", "1.0.2").start(), CoreOptions.mavenBundle("org.ogema.external", "org.apache.felix.useradmin", "1.0.3").start(), CoreOptions.mavenBundle("org.osgi", "org.osgi.service.useradmin", "1.1.0").start(), CoreOptions.mavenBundle("org.apache.felix", "org.apache.felix.configadmin", "1.9.0").start(), CoreOptions.mavenBundle("org.apache.felix", "org.apache.felix.http.jetty", "3.1.6").start(), // higher jetty versions require java 8 CoreOptions.mavenBundle("org.eclipse.jetty", "jetty-servlets", "9.2.14.v20151106"), CoreOptions.mavenBundle("javax.servlet", "javax.servlet-api", "3.1.0"), CoreOptions.mavenBundle("org.ogema.core", "models").version(ogemaVersion).startLevel(1).start(), CoreOptions.mavenBundle("org.ogema.core", "api").version(ogemaVersion).startLevel(1).start(), CoreOptions.mavenBundle("org.ogema.tools", "memory-timeseries").version(ogemaVersion).start(), CoreOptions.mavenBundle("org.ogema.ref-impl", "administration").version(ogemaVersion).start(), CoreOptions.mavenBundle("org.ogema.ref-impl", "ogema-exam-base2").version(ogemaVersion).start(), CoreOptions.mavenBundle("org.ogema.ref-impl", "internal-api").version(ogemaVersion).start(), CoreOptions.mavenBundle("org.ogema.ref-impl", "non-secure-apploader").version(ogemaVersion).start(), CoreOptions.mavenBundle("org.ogema.ref-impl", "ogema-logger").version(ogemaVersion).start(), CoreOptions.mavenBundle("org.ogema.ref-impl", "app-manager").version(ogemaVersion).start(), CoreOptions.mavenBundle("org.ogema.ref-impl", "resource-manager").version(ogemaVersion).start(), CoreOptions.mavenBundle("org.ogema.ref-impl", "resource-access-advanced").version(ogemaVersion).start(), CoreOptions.mavenBundle("org.ogema.ref-impl", "security").version(ogemaVersion).startLevel(4).start(),
public static Option jsfBundlesWithDependencies() { return composite( // MyFaces mavenBundle("org.apache.myfaces.core", "myfaces-api").versionAsInProject(), mavenBundle("org.apache.myfaces.core", "myfaces-impl").versionAsInProject(), mavenBundle("javax.interceptor", "javax.interceptor-api").version("1.2"), mavenBundle("javax.enterprise", "cdi-api").version("1.2"), mavenBundle("javax.validation", "validation-api").version("1.1.0.Final"), // Commons mavenBundle("commons-io", "commons-io").version("1.4"), mavenBundle("commons-codec", "commons-codec").version("1.10"), mavenBundle("commons-beanutils", "commons-beanutils").version("1.8.3"), mavenBundle("commons-collections", "commons-collections").version("3.2.2"), mavenBundle("commons-digester", "commons-digester").version("1.8.1"), mavenBundle("org.apache.commons", "commons-lang3").version("3.4") ); }
/** * Convenience method (shorter) for adding a maven bundle based on groupId/artifactId. * * @param groupId * artifact group id * @param artifactId * artifact id * * @return maven specific provisioning option */ public static MavenArtifactProvisionOption mavenBundle(final String groupId, final String artifactId) { return mavenBundle().groupId(groupId).artifactId(artifactId); }
/** * Create an provisioning option for the specified maven artifact * (groupId and artifactId), using the version found in the list * of dependencies of this maven project. * * @param groupId the groupId of the maven bundle * @param artifactId the artifactId of the maven bundle * @return the provisioning option for the given bundle */ public static MavenArtifactProvisionOption mavenBundle(String groupId, String artifactId) { return CoreOptions.mavenBundle(groupId, artifactId).versionAsInProject(); }
protected Bundle installBundle(String groupId, String artifactId) throws Exception { MavenArtifactProvisionOption mvnUrl = CoreOptions.mavenBundle(groupId, artifactId).versionAsInProject(); return bundleContext.installBundle(mvnUrl.getURL()); }
String value = startupProps.getProperty(name); MavenArtifactProvisionOption opt = convertToMaven(name); if (opt.getURL().contains("org.apache.felix.karaf.features")) { opt.noStart(); opt.startLevel(Integer.parseInt(value)); options.add(opt);
public static Option configMinumumBundles() { return new DefaultCompositeOption( mavenBundle(CONTROLLER, "config-api").versionAsInProject(), // // bindingAwareSalBundles(), mavenBundle("commons-codec", "commons-codec").versionAsInProject(), systemPackages("sun.nio.ch", "sun.misc"), mavenBundle(CONTROLLER, "config-manager").versionAsInProject(), // // mavenBundle(CONTROLLER, "config-util").versionAsInProject(), // // mavenBundle("commons-io", "commons-io").versionAsInProject(), // mavenBundle(CONTROLLER, "config-manager-facade-xml").versionAsInProject(), // mavenBundle(CONTROLLER, "yang-jmx-generator").versionAsInProject(), // mavenBundle(CONTROLLER, "logback-config").versionAsInProject(), // mavenBundle(CONTROLLER, "config-persister-api").versionAsInProject(), // mavenBundle(CONTROLLER, "config-persister-impl").versionAsInProject(), // mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.xerces", "2.11.0_1"), mavenBundle("org.eclipse.birt.runtime.3_7_1", "org.apache.xml.resolver", "1.2.0"), mavenBundle(CONTROLLER, "config-persister-file-xml-adapter").versionAsInProject().noStart(), mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.moxy").versionAsInProject(), mavenBundle("org.eclipse.persistence", "org.eclipse.persistence.core").versionAsInProject()); }
mavenBundle("org.javassist", "javassist").versionAsInProject(), // // mavenBundle(YANGTOOLS, "yang-data-api").versionAsInProject(), // // mavenBundle(YANGTOOLS, "yang-data-util").versionAsInProject(), // // mavenBundle(YANGTOOLS, "yang-data-impl").versionAsInProject(), // // mavenBundle(YANGTOOLS, "yang-model-api").versionAsInProject(), // // mavenBundle(YANGTOOLS, "yang-model-util").versionAsInProject(), // // mavenBundle(YANGTOOLS, "yang-parser-api").versionAsInProject(), // mavenBundle(YANGTOOLS, "yang-parser-impl").versionAsInProject(), // mavenBundle(MDSAL, "mdsal-binding-generator-api").versionAsInProject(), // mavenBundle(MDSAL, "mdsal-binding-generator-util").versionAsInProject(), // mavenBundle(MDSAL, "mdsal-binding-generator-impl").versionAsInProject(), mavenBundle(MDSAL, "mdsal-binding-dom-codec").versionAsInProject(), mavenBundle("org.antlr", "antlr4-runtime").versionAsInProject(), // // mavenBundle(CONTROLLER, "sal-binding-util").versionAsInProject(), // mavenBundle(CONTROLLER, "sal-common-util").versionAsInProject(), // // mavenBundle(CONTROLLER, "sal-core-api").versionAsInProject().update(), // mavenBundle(CONTROLLER, "sal-binding-api").versionAsInProject(), // // mavenBundle("com.lmax", "disruptor").versionAsInProject(), // mavenBundle(CONTROLLER, "sal-broker-impl").versionAsInProject(), // // mavenBundle(CONTROLLER, "sal-dom-config").versionAsInProject(), // // mavenBundle(CONTROLLER, "sal-inmemory-datastore").versionAsInProject(), // mavenBundle(CONTROLLER, "sal-dom-broker-config").versionAsInProject(), // // mavenBundle(CONTROLLER, "sal-core-spi").versionAsInProject().update(), //