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..7964d22 100644 --- a/pom.xml +++ b/pom.xml @@ -41,6 +41,9 @@ 3.0.2 5.7.0 3.17.2 + 6.0.0 + 8.0.0 + 1 UTF-8 UTF-8 1.0.3 @@ -62,18 +65,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 +113,43 @@ + + biz.aQute.bnd + bnd-maven-plugin + ${bnd.version} + + + + bnd-process + + + + + + + org.apache.maven.plugins maven-compiler-plugin @@ -129,12 +173,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..5fb1ed2 100644 --- a/r2dbc-spi-test/pom.xml +++ b/r2dbc-spi-test/pom.xml @@ -77,6 +77,10 @@ + + biz.aQute.bnd + bnd-maven-plugin + org.apache.maven.plugins maven-compiler-plugin @@ -84,16 +88,6 @@ org.apache.maven.plugins maven-jar-plugin - - - - true - - - r2dbc.spi.test - - - org.apache.maven.plugins diff --git a/r2dbc-spi/pom.xml b/r2dbc-spi/pom.xml index d63f58b..9e54e9c 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 @@ -63,6 +73,15 @@ + + biz.aQute.bnd + bnd-maven-plugin + + + + org.apache.maven.plugins maven-compiler-plugin @@ -70,13 +89,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 { /**