This is an automated email from the ASF dual-hosted git repository. stbischof pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/felix-dev.git
commit fe0772d9373b1bb8435e8aac8952c9f8a806da87 Author: Arnoud Glimmerveen <[email protected]> AuthorDate: Wed May 14 21:35:22 2025 +0200 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. --- scr/pom.xml | 33 ++++++++++++++++++++-- .../felix/scr/integration/ComponentTestBase.java | 24 ++++++++-------- 2 files changed, 41 insertions(+), 16 deletions(-) diff --git a/scr/pom.xml b/scr/pom.xml index 148a82b8ca..6737bc15ca 100644 --- a/scr/pom.xml +++ b/scr/pom.xml @@ -65,7 +65,6 @@ <bundle.file.name> ${bundle.build.name}/${project.build.finalName}.jar </bundle.file.name> - <felix.ca.version>1.9.0</felix.ca.version> <java.version>8</java.version> <felix.java.version>${java.version}</felix.java.version> @@ -121,13 +120,13 @@ <dependency> <groupId>org.osgi</groupId> <artifactId>org.osgi.util.promise</artifactId> - <version>1.0.0</version> + <version>1.1.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.osgi</groupId> <artifactId>org.osgi.util.function</artifactId> - <version>1.0.0</version> + <version>1.1.0</version> <scope>provided</scope> </dependency> <dependency> @@ -251,6 +250,18 @@ <version>5.0.4</version> <scope>test</scope> </dependency> + <dependency> + <groupId>org.osgi</groupId> + <artifactId>org.osgi.util.pushstream</artifactId> + <version>1.0.0</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.felix</groupId> + <artifactId>org.apache.felix.configadmin</artifactId> + <version>1.9.0</version> + <scope>test</scope> + </dependency> </dependencies> <build> <directory>${bundle.build.name}</directory> @@ -316,6 +327,22 @@ <source>${java.version}</source> </configuration> </plugin> + <plugin> + <groupId>org.apache.servicemix.tooling</groupId> + <artifactId>depends-maven-plugin</artifactId> + <version>1.5.0</version> + <executions> + <execution> + <goals> + <goal>generate-depends-file</goal> + </goals> + <phase>pre-integration-test</phase> + <configuration> + <outputFile>${project.build.testOutputDirectory}/META-INF/maven/dependencies.properties</outputFile> + </configuration> + </execution> + </executions> + </plugin> </plugins> </build> diff --git a/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java b/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java index 81cb0e804d..19ee076e9d 100644 --- a/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java +++ b/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java @@ -139,8 +139,6 @@ public abstract class ComponentTestBase //set to true to only get last 1000 lines of log. protected static boolean restrictedLogging; - protected static String felixCaVersion = System.getProperty( "felix.ca.version" ); - protected static final String PROP_NAME_FACTORY = ComponentTestBase.PROP_NAME + ".factory"; static @@ -185,17 +183,17 @@ public abstract class ComponentTestBase final Option[] base = options( provision( CoreOptions.bundle( bundleFile.toURI().toString() ), - mavenBundle( "org.ops4j.pax.tinybundles", "tinybundles", "1.0.0" ), - mavenBundle( "org.osgi", "org.osgi.service.log", "1.4.0"), - mavenBundle( "org.slf4j", "slf4j-api", "1.7.32" ), - mavenBundle( "ch.qos.logback", "logback-core", "1.2.12" ), - mavenBundle( "ch.qos.logback", "logback-classic", "1.2.12" ), - mavenBundle( "org.osgi", "org.osgi.util.pushstream", "1.0.0"), - mavenBundle( "org.apache.felix", "org.apache.felix.configadmin", felixCaVersion ) ), - mavenBundle( "org.osgi", "org.osgi.util.promise", "1.3.0" ), - mavenBundle( "org.osgi", "org.osgi.util.function", "1.2.0" ), - mavenBundle( "org.osgi", "org.osgi.service.component", "1.5.1" ), - mavenBundle( "org.ops4j.pax.url", "pax-url-aether", "2.6.2"), + mavenBundle( "org.ops4j.pax.tinybundles", "tinybundles" ).versionAsInProject(), + mavenBundle( "org.osgi", "org.osgi.service.log" ).versionAsInProject(), + mavenBundle( "org.slf4j", "slf4j-api" ).versionAsInProject(), + mavenBundle( "ch.qos.logback", "logback-core" ).versionAsInProject(), + mavenBundle( "ch.qos.logback", "logback-classic" ).versionAsInProject(), + mavenBundle( "org.osgi", "org.osgi.util.pushstream" ).versionAsInProject(), + mavenBundle( "org.apache.felix", "org.apache.felix.configadmin" ).versionAsInProject() ), + mavenBundle( "org.osgi", "org.osgi.util.promise" ).versionAsInProject(), + mavenBundle( "org.osgi", "org.osgi.util.function" ).versionAsInProject(), + mavenBundle( "org.osgi", "org.osgi.service.component" ).versionAsInProject(), + mavenBundle( "org.ops4j.pax.url", "pax-url-aether" ).versionAsInProject(), junitBundles(), frameworkProperty( "org.osgi.framework.bsnversion" ).value( bsnVersionUniqueness ), systemProperty( "ds.factory.enabled" ).value( Boolean.toString( NONSTANDARD_COMPONENT_FACTORY_BEHAVIOR ) ), systemProperty( "ds.loglevel" ).value( DS_LOGLEVEL ),
