diff --git a/.gitignore b/.gitignore index 79f736d..fd996a1 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,11 @@ dependency-reduced-pom.xml buildNumber.properties .mvn/timing.properties +# Eclipse +.project +.classpath +.settings + # IntelliJ out/ build/ diff --git a/pom.xml b/pom.xml index 698aedf..90e3476 100644 --- a/pom.xml +++ b/pom.xml @@ -41,10 +41,14 @@ 3.0.2 5.7.0 3.17.2 + 6.0.0 + 8.0.0 + 1 UTF-8 UTF-8 1.0.3 Dysprosium-SR12 + 5.2.6.RELEASE @@ -62,18 +66,22 @@ + nebhale Ben Hale bhale@pivotal.io + mp911de Mark Paluch mpaluch@vmware.com + mirromutth Mirro Mutth mirromutth@gmail.com + gregturn Greg Turnquist gturnquist@pivotal.io @@ -106,6 +114,68 @@ + + biz.aQute.bnd + bnd-maven-plugin + ${bnd.version} + + + + bnd-process + + + + + + + + + biz.aQute.bnd + bnd-resolver-maven-plugin + ${bnd.version} + + + integration-test + + resolve + + + + + + verifyOSGi.bndrun + + false + false + + compile + test + + false + + org.apache.maven.plugins maven-compiler-plugin @@ -129,12 +199,7 @@ 3.2.0 - - true - - - ${project.version} - + ${project.build.outputDirectory}/META-INF/MANIFEST.MF diff --git a/r2dbc-spi-test/pom.xml b/r2dbc-spi-test/pom.xml index e0c3469..ee35ba2 100644 --- a/r2dbc-spi-test/pom.xml +++ b/r2dbc-spi-test/pom.xml @@ -66,17 +66,67 @@ org.springframework spring-jdbc - 5.2.6.RELEASE + ${spring.version} com.google.code.findbugs jsr305 provided + + org.apache.aries.spifly + org.apache.aries.spifly.dynamic.framework.extension + 1.3.4 + test + + + org.apache.servicemix.bundles + org.apache.servicemix.bundles.spring-beans + ${spring.version}_1 + test + + + org.apache.servicemix.bundles + org.apache.servicemix.bundles.spring-context + ${spring.version}_1 + test + + + org.apache.servicemix.bundles + org.apache.servicemix.bundles.spring-core + ${spring.version}_1 + test + + + org.apache.servicemix.bundles + org.apache.servicemix.bundles.spring-jdbc + ${spring.version}_1 + test + + + org.apache.servicemix.bundles + org.apache.servicemix.bundles.spring-tx + ${spring.version}_1 + test + + + org.eclipse.platform + org.eclipse.osgi + 3.17.0 + test + + + biz.aQute.bnd + bnd-maven-plugin + + + biz.aQute.bnd + bnd-resolver-maven-plugin + org.apache.maven.plugins maven-compiler-plugin @@ -84,16 +134,6 @@ org.apache.maven.plugins maven-jar-plugin - - - - true - - - r2dbc.spi.test - - - org.apache.maven.plugins diff --git a/r2dbc-spi-test/verifyOSGi.bndrun b/r2dbc-spi-test/verifyOSGi.bndrun new file mode 100644 index 0000000..a5d6de5 --- /dev/null +++ b/r2dbc-spi-test/verifyOSGi.bndrun @@ -0,0 +1,8 @@ +-runfw: org.eclipse.osgi +-resolve.effective: resolve, active + +-runsystempackages: \ + sun.misc + +-runsystemcapabilities: \ + osgi.serviceloader;osgi.serviceloader=io.r2dbc.spi.ConnectionFactoryProvider diff --git a/r2dbc-spi/pom.xml b/r2dbc-spi/pom.xml index d63f58b..9320eef 100644 --- a/r2dbc-spi/pom.xml +++ b/r2dbc-spi/pom.xml @@ -39,6 +39,16 @@ reactive-streams ${reactive-streams.version} + + biz.aQute.bnd + biz.aQute.bnd.annotation + ${bnd.version} + + + org.osgi + osgi.annotation + ${osgi.annotation.version} + com.google.code.findbugs jsr305 @@ -59,10 +69,35 @@ assertj-core test + + org.apache.aries.spifly + org.apache.aries.spifly.dynamic.framework.extension + 1.3.4 + test + + + org.eclipse.platform + org.eclipse.osgi + 3.17.0 + test + + + biz.aQute.bnd + bnd-maven-plugin + + + + + + biz.aQute.bnd + bnd-resolver-maven-plugin + org.apache.maven.plugins maven-compiler-plugin @@ -70,13 +105,6 @@ org.apache.maven.plugins maven-jar-plugin - - - - r2dbc.spi - - - org.apache.maven.plugins diff --git a/r2dbc-spi/src/main/java/io/r2dbc/spi/ConnectionFactoryProvider.java b/r2dbc-spi/src/main/java/io/r2dbc/spi/ConnectionFactoryProvider.java index 6a3dc89..d42cca7 100644 --- a/r2dbc-spi/src/main/java/io/r2dbc/spi/ConnectionFactoryProvider.java +++ b/r2dbc-spi/src/main/java/io/r2dbc/spi/ConnectionFactoryProvider.java @@ -16,8 +16,13 @@ package io.r2dbc.spi; +import static aQute.bnd.annotation.Cardinality.MULTIPLE; +import static aQute.bnd.annotation.Resolution.OPTIONAL; + import java.util.ServiceLoader; +import aQute.bnd.annotation.spi.ServiceConsumer; + /** * A Java Service interface for implementations to examine a collection of {@link ConnectionFactoryOptions} and optionally return an implementation of {@link ConnectionFactory}. *

{@link ConnectionFactoryProvider} implementations are typically discovered by {@link ConnectionFactories} from the class path using {@link ServiceLoader}. @@ -27,6 +32,15 @@ * @see ConnectionFactories * @see ServiceLoader */ + +@ServiceConsumer( + // This instance enables resolving a provider at _assembly_ without incurring a strict runtime + // dependency on Service Loader Mediator (SML) impl + cardinality = MULTIPLE, effective = "active", value = ConnectionFactoryProvider.class) +@ServiceConsumer( + // This instance enables SML to instrument ServiceLoader calls _if SML is present_ + // (without preventing the bundles from resolving if it is not) + cardinality = MULTIPLE, resolution = OPTIONAL, value = ConnectionFactoryProvider.class) public interface ConnectionFactoryProvider { /** diff --git a/r2dbc-spi/verifyOSGi.bndrun b/r2dbc-spi/verifyOSGi.bndrun new file mode 100644 index 0000000..a5d6de5 --- /dev/null +++ b/r2dbc-spi/verifyOSGi.bndrun @@ -0,0 +1,8 @@ +-runfw: org.eclipse.osgi +-resolve.effective: resolve, active + +-runsystempackages: \ + sun.misc + +-runsystemcapabilities: \ + osgi.serviceloader;osgi.serviceloader=io.r2dbc.spi.ConnectionFactoryProvider