Skip to content

Commit fe0772d

Browse files
glimmerveenstbischof
authored andcommitted
Replaced the static versions referenced by ComponentTestBase, with obtaining these versions from the SCR maven project itself.
This relies on the depends-maven-plugin on generating a properties file, that is read by the .versionAsInProject() Pax mavenBundle option API. Needed to update two existing dependencies, and add two test dependencies in order for the bundles used to be mutually consistent versions.
1 parent 3aef950 commit fe0772d

File tree

2 files changed

+41
-16
lines changed

2 files changed

+41
-16
lines changed

scr/pom.xml

+30-3
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
<bundle.file.name>
6666
${bundle.build.name}/${project.build.finalName}.jar
6767
</bundle.file.name>
68-
<felix.ca.version>1.9.0</felix.ca.version>
6968

7069
<java.version>8</java.version>
7170
<felix.java.version>${java.version}</felix.java.version>
@@ -121,13 +120,13 @@
121120
<dependency>
122121
<groupId>org.osgi</groupId>
123122
<artifactId>org.osgi.util.promise</artifactId>
124-
<version>1.0.0</version>
123+
<version>1.1.0</version>
125124
<scope>provided</scope>
126125
</dependency>
127126
<dependency>
128127
<groupId>org.osgi</groupId>
129128
<artifactId>org.osgi.util.function</artifactId>
130-
<version>1.0.0</version>
129+
<version>1.1.0</version>
131130
<scope>provided</scope>
132131
</dependency>
133132
<dependency>
@@ -251,6 +250,18 @@
251250
<version>5.0.4</version>
252251
<scope>test</scope>
253252
</dependency>
253+
<dependency>
254+
<groupId>org.osgi</groupId>
255+
<artifactId>org.osgi.util.pushstream</artifactId>
256+
<version>1.0.0</version>
257+
<scope>test</scope>
258+
</dependency>
259+
<dependency>
260+
<groupId>org.apache.felix</groupId>
261+
<artifactId>org.apache.felix.configadmin</artifactId>
262+
<version>1.9.0</version>
263+
<scope>test</scope>
264+
</dependency>
254265
</dependencies>
255266
<build>
256267
<directory>${bundle.build.name}</directory>
@@ -316,6 +327,22 @@
316327
<source>${java.version}</source>
317328
</configuration>
318329
</plugin>
330+
<plugin>
331+
<groupId>org.apache.servicemix.tooling</groupId>
332+
<artifactId>depends-maven-plugin</artifactId>
333+
<version>1.5.0</version>
334+
<executions>
335+
<execution>
336+
<goals>
337+
<goal>generate-depends-file</goal>
338+
</goals>
339+
<phase>pre-integration-test</phase>
340+
<configuration>
341+
<outputFile>${project.build.testOutputDirectory}/META-INF/maven/dependencies.properties</outputFile>
342+
</configuration>
343+
</execution>
344+
</executions>
345+
</plugin>
319346
</plugins>
320347
</build>
321348

scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java

+11-13
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,6 @@ public abstract class ComponentTestBase
139139
//set to true to only get last 1000 lines of log.
140140
protected static boolean restrictedLogging;
141141

142-
protected static String felixCaVersion = System.getProperty( "felix.ca.version" );
143-
144142
protected static final String PROP_NAME_FACTORY = ComponentTestBase.PROP_NAME + ".factory";
145143

146144
static
@@ -185,17 +183,17 @@ public static Option[] configuration()
185183
final Option[] base = options(
186184
provision(
187185
CoreOptions.bundle( bundleFile.toURI().toString() ),
188-
mavenBundle( "org.ops4j.pax.tinybundles", "tinybundles", "1.0.0" ),
189-
mavenBundle( "org.osgi", "org.osgi.service.log", "1.4.0"),
190-
mavenBundle( "org.slf4j", "slf4j-api", "1.7.32" ),
191-
mavenBundle( "ch.qos.logback", "logback-core", "1.2.12" ),
192-
mavenBundle( "ch.qos.logback", "logback-classic", "1.2.12" ),
193-
mavenBundle( "org.osgi", "org.osgi.util.pushstream", "1.0.0"),
194-
mavenBundle( "org.apache.felix", "org.apache.felix.configadmin", felixCaVersion ) ),
195-
mavenBundle( "org.osgi", "org.osgi.util.promise", "1.3.0" ),
196-
mavenBundle( "org.osgi", "org.osgi.util.function", "1.2.0" ),
197-
mavenBundle( "org.osgi", "org.osgi.service.component", "1.5.1" ),
198-
mavenBundle( "org.ops4j.pax.url", "pax-url-aether", "2.6.2"),
186+
mavenBundle( "org.ops4j.pax.tinybundles", "tinybundles" ).versionAsInProject(),
187+
mavenBundle( "org.osgi", "org.osgi.service.log" ).versionAsInProject(),
188+
mavenBundle( "org.slf4j", "slf4j-api" ).versionAsInProject(),
189+
mavenBundle( "ch.qos.logback", "logback-core" ).versionAsInProject(),
190+
mavenBundle( "ch.qos.logback", "logback-classic" ).versionAsInProject(),
191+
mavenBundle( "org.osgi", "org.osgi.util.pushstream" ).versionAsInProject(),
192+
mavenBundle( "org.apache.felix", "org.apache.felix.configadmin" ).versionAsInProject() ),
193+
mavenBundle( "org.osgi", "org.osgi.util.promise" ).versionAsInProject(),
194+
mavenBundle( "org.osgi", "org.osgi.util.function" ).versionAsInProject(),
195+
mavenBundle( "org.osgi", "org.osgi.service.component" ).versionAsInProject(),
196+
mavenBundle( "org.ops4j.pax.url", "pax-url-aether" ).versionAsInProject(),
199197
junitBundles(), frameworkProperty( "org.osgi.framework.bsnversion" ).value( bsnVersionUniqueness ),
200198
systemProperty( "ds.factory.enabled" ).value( Boolean.toString( NONSTANDARD_COMPONENT_FACTORY_BEHAVIOR ) ),
201199
systemProperty( "ds.loglevel" ).value( DS_LOGLEVEL ),

0 commit comments

Comments
 (0)