}
@Configuration
public Option[] config() {
// ports to override values from etc/org.apache.karaf.management.cfg
int rmiRegistryPort = new FreePort(RMI_BASE_PORT + 1, RMI_BASE_PORT + 100).getPort();
int rmiServerPort = new FreePort(rmiRegistryPort +1, rmiRegistryPort + 100).getPort();
LOGGER.info("Port selected for Karaf RMI Registry: {}", rmiRegistryPort);
LOGGER.info("Port selected for JMX Server connection: {}", rmiServerPort);
return new Option[]{
karafDistributionConfiguration().frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf").versionAsInProject().type("tar.gz"))
.karafVersion(MavenUtils.getArtifactVersion("org.apache.karaf", "apache-karaf")).name("Apache Karaf").unpackDirectory(new File("target/exam")),