[AMQ-7076] Does not define spring-legacy repository by default in ActiveMQ Karaf... 320/head
authorJean-Baptiste Onofré <jbonofre@apache.org>
Thu, 22 Nov 2018 08:27:09 +0000 (09:27 +0100)
committerJean-Baptiste Onofré <jbonofre@apache.org>
Thu, 22 Nov 2018 15:07:51 +0000 (16:07 +0100)
activemq-karaf-itest/src/test/java/org/apache/activemq/karaf/itest/AbstractFeatureTest.java
activemq-karaf/src/main/resources/features-core.xml

index ee8f03b..ae45204 100644 (file)
@@ -20,12 +20,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.ops4j.pax.exam.CoreOptions.composite;
 import static org.ops4j.pax.exam.CoreOptions.maven;
-import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
-import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features;
-import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
-import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
-import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel;
-import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.replaceConfigurationFile;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.*;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -146,6 +141,7 @@ public abstract class AbstractFeatureTest {
     }
 
     public static Option configure(String... features) {
+        String karafVersion = MavenUtils.getArtifactVersion("org.apache.karaf", "apache-karaf");
         MavenUrlReference karafUrl = maven().groupId("org.apache.karaf").artifactId("apache-karaf")
             .type("tar.gz").versionAsInProject();
         UrlReference camelUrl = maven().groupId("org.apache.camel.karaf")
@@ -158,6 +154,8 @@ public abstract class AbstractFeatureTest {
          keepRuntimeFolder(), //
          logLevel(LogLevelOption.LogLevel.INFO), //
          editConfigurationFilePut("etc/config.properties", "karaf.startlevel.bundle", "50"),
+         editConfigurationFileExtend("etc/org.apache.karaf.features.cfg", "featuresRepositories",
+                 "mvn:org.apache.karaf.features/spring-legacy/" + karafVersion + "/xml/features"),
          // debugConfiguration("5005", true),
          features(activeMQUrl, features), //
          features(camelUrl)
index fdb90db..789a991 100644 (file)
@@ -20,7 +20,8 @@
 
 <features name="activemq-core-${project.version}">
 
-    <repository>mvn:org.apache.karaf.features/spring-legacy/[4,5)/xml/features</repository>
+    <!-- In order to work with any Karaf version, the user has to add spring-legacy features repo by hand corresponding to his Karaf version -->
+    <!-- <repository>mvn:org.apache.karaf.features/spring-legacy/[4,5)/xml/features</repository> -->
 
     <!-- Bundles needed if only client will be deployed in the container -->
     <feature name="activemq-client" description="ActiveMQ client libraries" version="${project.version}" resolver="(obr)" start-level="50">