From 23921b3186760575ca177186af992bd3f578f5d3 Mon Sep 17 00:00:00 2001 From: Ross Lawley Date: Mon, 6 Sep 2021 10:53:56 +0100 Subject: [PATCH] Fix manifest import-package imports (#779) JAVA-4274 --- bson-scala/build.gradle | 5 ++++- driver-core/build.gradle | 24 +++++++++--------------- driver-reactive-streams/build.gradle | 4 +--- driver-scala/build.gradle | 4 ++-- driver-sync/build.gradle | 3 +-- 5 files changed, 17 insertions(+), 23 deletions(-) diff --git a/bson-scala/build.gradle b/bson-scala/build.gradle index 31430fcec83..be596906e63 100644 --- a/bson-scala/build.gradle +++ b/bson-scala/build.gradle @@ -48,4 +48,7 @@ test { maxParallelForks = 1 } -jar.manifest.attributes['Import-Package'] = 'org.bson.*' +jar.manifest.attributes['Import-Package'] = [ + '!scala.*', + '*' +].join(',') diff --git a/driver-core/build.gradle b/driver-core/build.gradle index d7e116fe044..c8ed033fead 100644 --- a/driver-core/build.gradle +++ b/driver-core/build.gradle @@ -64,20 +64,14 @@ afterEvaluate { jar.manifest.attributes['Automatic-Module-Name'] = 'org.mongodb.driver.core' jar.manifest.attributes['Bundle-SymbolicName'] = 'org.mongodb.driver-core' jar.manifest.attributes['Import-Package'] = [ - 'org.bson.*', // unfortunate that this is necessary, but if it's left out then it's not included - 'javax.crypto.*', - 'javax.management.*', - 'javax.naming.*', - 'javax.net.*', - 'jdk.net.*', - 'javax.security.sasl.*', - 'javax.security.auth.callback.*', - 'org.ietf.jgss.*', - 'io.netty.*;resolution:=optional', - 'org.xerial.snappy.*;resolution:=optional', - 'com.github.luben.zstd.*;resolution:=optional', - 'org.slf4j.*;resolution:=optional', - 'jnr.unixsocket.*;resolution:=optional', - 'com.mongodb.crypt.capi.*;resolution:=optional' + '!sun.misc.*', // Used by DirectBufferDeallocator only for java 8 + '!sun.nio.ch.*', // Used by DirectBufferDeallocator only for java 8 + 'io.netty.*;resolution:=optional', + 'org.xerial.snappy.*;resolution:=optional', + 'com.github.luben.zstd.*;resolution:=optional', + 'org.slf4j.*;resolution:=optional', + 'jnr.unixsocket.*;resolution:=optional', + 'com.mongodb.crypt.capi.*;resolution:=optional', + '*' // import all that is not excluded or modified before ].join(',') } diff --git a/driver-reactive-streams/build.gradle b/driver-reactive-streams/build.gradle index 8754b5cb9d1..9f41faac049 100644 --- a/driver-reactive-streams/build.gradle +++ b/driver-reactive-streams/build.gradle @@ -69,9 +69,7 @@ afterEvaluate { jar.manifest.attributes['Automatic-Module-Name'] = 'org.mongodb.driver.reactivestreams' jar.manifest.attributes['Bundle-SymbolicName'] = 'org.mongodb.driver-reactivestreams' jar.manifest.attributes['Import-Package'] = [ - 'org.bson.*', 'com.mongodb.crypt.capi.*;resolution:=optional', - 'com.mongodb.*', - 'reactor.core.*', + '*', ].join(',') } diff --git a/driver-scala/build.gradle b/driver-scala/build.gradle index fc4159cf600..5e30bbe95a8 100644 --- a/driver-scala/build.gradle +++ b/driver-scala/build.gradle @@ -100,7 +100,7 @@ ext { afterEvaluate { jar.manifest.attributes['Automatic-Module-Name'] = 'org.mongodb.scala.mongo-scala-driver' jar.manifest.attributes['Import-Package'] = [ - 'org.bson.*', - 'com.mongodb.*', + '!scala.*', + '*' ].join(',') } diff --git a/driver-sync/build.gradle b/driver-sync/build.gradle index 36fbc17ea43..37a4bd003b9 100644 --- a/driver-sync/build.gradle +++ b/driver-sync/build.gradle @@ -46,8 +46,7 @@ afterEvaluate { jar.manifest.attributes['Automatic-Module-Name'] = 'org.mongodb.driver.sync.client' jar.manifest.attributes['Bundle-SymbolicName'] = 'org.mongodb.driver-sync' jar.manifest.attributes['Import-Package'] = [ - 'org.bson.*', 'com.mongodb.crypt.capi.*;resolution:=optional', - 'com.mongodb.*', + '*', ].join(',') }