private static Option getOptions( final Method methodName, final Collection<JUnit4ConfigMethod> configMethods) throws Exception { // always add the junit extender final DefaultCompositeOption option = new DefaultCompositeOption( mavenBundle() .groupId("org.ops4j.pax.exam") .artifactId("pax-exam") .version(Info.getPaxExamVersion()) .update(Info.isPaxExamSnapshotVersion()) .startLevel(START_LEVEL_SYSTEM_BUNDLES), mavenBundle() .groupId("org.ops4j.pax.exam") .artifactId("pax-exam-junit-extender") .version(Info.getPaxExamVersion()) .update(Info.isPaxExamSnapshotVersion()) .startLevel(START_LEVEL_SYSTEM_BUNDLES), mavenBundle() .groupId("org.ops4j.pax.exam") .artifactId("pax-exam-junit-extender-impl") .version(Info.getPaxExamVersion()) .update(Info.isPaxExamSnapshotVersion()) .startLevel(START_LEVEL_SYSTEM_BUNDLES)); // add options based on available configuration options from the test itself for (JUnit4ConfigMethod configMethod : configMethods) { if (configMethod.matches(methodName)) { option.add(configMethod.getOptions()); } } // add junit bundles, if the user did not add junit bundles into configuration if (OptionUtils.filter(JUnitBundlesOption.class, option).length == 0) { option.add(junitBundles()); } return option; }