/** * 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")) ); }
/** * 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); }
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); } }
/** * 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); }
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 MavenArtifactProvisionOption mavenBundle(String groupId, String artifactId) { return CoreOptions.mavenBundle().groupId(groupId).artifactId(artifactId).versionAsInProject(); }
/** * 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") ); }
/** * Convenience method (shorter) for adding a maven bundle based on groupId/artifactId/version. * * @param groupId * artifact group id * @param artifactId * artifact id * @param version * artifact version * * @return maven specific provisioning option */ public static MavenArtifactProvisionOption mavenBundle(final String groupId, final String artifactId, final String version) { return mavenBundle().groupId(groupId).artifactId(artifactId).version(version); }
/** * Convenience method (shorter) for adding a maven bundle based on groupId/artifactId/version. * * @param groupId * artifact group id * @param artifactId * artifact id * @param version * artifact version * * @return maven specific provisioning option */ public static MavenArtifactProvisionOption mavenBundle(final String groupId, final String artifactId, final String version) { return mavenBundle().groupId(groupId).artifactId(artifactId).version(version); }
/** * For use in the actual test code, which runs in OSGi and has no normal access to the configuration options * @param groupId * @param artifactId * @return */ public static MavenArtifactProvisionOption mavenBundleInTest(ClassLoader loader, String groupId, String artifactId) { return CoreOptions.mavenBundle().groupId(groupId).artifactId(artifactId) .version(getArtifactVersion(loader, groupId, artifactId)); }
public static UrlReference getCamelKarafFeatureUrl() { return mavenBundle(). groupId("org.apache.camel.karaf"). artifactId("apache-camel"). version(getCamelKarafFeatureVersion()). type("xml/features"); }
/** * Constructor. */ public JUnitBundlesOption() { super( mavenBundle() .groupId( "org.junit" ) .artifactId( "com.springsource.org.junit" ) .version( "4.4.0" ) ); noUpdate(); startLevel( START_LEVEL_SYSTEM_BUNDLES ); }
/** * Constructor. */ public EasyMockBundlesOption() { super( mavenBundle() .groupId( "org.easymock" ) .artifactId( "com.springsource.org.easymock" ) .version( "2.3.0" ) ); noUpdate(); startLevel( START_LEVEL_SYSTEM_BUNDLES ); }
public static Option paxJettyBundles() { return composite( mavenBundle().groupId("org.ops4j.pax.web") .artifactId("pax-web-jetty").version(asInProject()), mavenBundle().groupId("org.ops4j.pax.web") .artifactId("pax-web-runtime").version(asInProject()), mavenBundle().groupId("org.eclipse.jetty") .artifactId("jetty-util").version(asInProject()), mavenBundle().groupId("org.eclipse.jetty") .artifactId("jetty-io").version(asInProject()), mavenBundle().groupId("org.eclipse.jetty") .artifactId("jetty-http").version(asInProject()), mavenBundle().groupId("org.eclipse.jetty") .artifactId("jetty-continuation") .version(asInProject()), mavenBundle().groupId("org.eclipse.jetty") .artifactId("jetty-server").version(asInProject()), mavenBundle().groupId("org.eclipse.jetty") .artifactId("jetty-client").version(asInProject()), mavenBundle().groupId("org.eclipse.jetty") .artifactId("jetty-security").version(asInProject()), mavenBundle().groupId("org.eclipse.jetty") .artifactId("jetty-xml").version(asInProject()), mavenBundle().groupId("org.eclipse.jetty") .artifactId("jetty-servlet").version(asInProject())); }
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; }
/** * 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("org.apache.camel").artifactId("camel-test-karaf").versionAsInProject() };
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() );
linkBundle("org.apache.xbean.bundleutils"), linkBundle("org.apache.xbean.finder"), mavenBundle().groupId("org.apache.xbean") .artifactId("xbean-reflect").version(asInProject()), mavenBundle("org.ow2.asm", "asm").versionAsInProject(), mavenBundle().groupId("org.ops4j.pax.url") .artifactId("pax-url-war") .type("jar") workspaceBundle("org.ops4j.pax.web", "pax-web-extender-whiteboard"), workspaceBundle("org.ops4j.pax.web", "pax-web-jsp"), mavenBundle().groupId("org.eclipse.jdt.core.compiler") .artifactId("ecj").version(asInProject()), mavenBundle().groupId("javax.el").artifactId("javax.el-api").versionAsInProject()
.groupId( "org.ops4j.pax.exam" ) .artifactId( "pax-exam" ) .version( Info.getPaxExamVersion() ) .startLevel( START_LEVEL_SYSTEM_BUNDLES ), mavenBundle() .groupId( "org.ops4j.pax.exam" ) .artifactId( "pax-exam-junit-extender" ) .version( Info.getPaxExamVersion() ) .startLevel( START_LEVEL_SYSTEM_BUNDLES ), mavenBundle() .groupId( "org.ops4j.pax.exam" ) .artifactId( "pax-exam-junit-extender-impl" ) .version( Info.getPaxExamVersion() )