Skip to content

Commit 926bd7f

Browse files
committed
Fix manifest import-package imports (#779)
JAVA-4274
1 parent 8c8ae83 commit 926bd7f

File tree

5 files changed

+17
-23
lines changed

5 files changed

+17
-23
lines changed

bson-scala/build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,7 @@ test {
4848
maxParallelForks = 1
4949
}
5050

51-
jar.manifest.attributes['Import-Package'] = 'org.bson.*'
51+
jar.manifest.attributes['Import-Package'] = [
52+
'!scala.*',
53+
'*'
54+
].join(',')

driver-core/build.gradle

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,14 @@ afterEvaluate {
6464
jar.manifest.attributes['Automatic-Module-Name'] = 'org.mongodb.driver.core'
6565
jar.manifest.attributes['Bundle-SymbolicName'] = 'org.mongodb.driver-core'
6666
jar.manifest.attributes['Import-Package'] = [
67-
'org.bson.*', // unfortunate that this is necessary, but if it's left out then it's not included
68-
'javax.crypto.*',
69-
'javax.management.*',
70-
'javax.naming.*',
71-
'javax.net.*',
72-
'jdk.net.*',
73-
'javax.security.sasl.*',
74-
'javax.security.auth.callback.*',
75-
'org.ietf.jgss.*',
76-
'io.netty.*;resolution:=optional',
77-
'org.xerial.snappy.*;resolution:=optional',
78-
'com.github.luben.zstd.*;resolution:=optional',
79-
'org.slf4j.*;resolution:=optional',
80-
'jnr.unixsocket.*;resolution:=optional',
81-
'com.mongodb.crypt.capi.*;resolution:=optional'
67+
'!sun.misc.*', // Used by DirectBufferDeallocator only for java 8
68+
'!sun.nio.ch.*', // Used by DirectBufferDeallocator only for java 8
69+
'io.netty.*;resolution:=optional',
70+
'org.xerial.snappy.*;resolution:=optional',
71+
'com.github.luben.zstd.*;resolution:=optional',
72+
'org.slf4j.*;resolution:=optional',
73+
'jnr.unixsocket.*;resolution:=optional',
74+
'com.mongodb.crypt.capi.*;resolution:=optional',
75+
'*' // import all that is not excluded or modified before
8276
].join(',')
8377
}

driver-reactive-streams/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ afterEvaluate {
6868
jar.manifest.attributes['Automatic-Module-Name'] = 'org.mongodb.driver.reactivestreams'
6969
jar.manifest.attributes['Bundle-SymbolicName'] = 'org.mongodb.driver-reactivestreams'
7070
jar.manifest.attributes['Import-Package'] = [
71-
'org.bson.*',
7271
'com.mongodb.crypt.capi.*;resolution:=optional',
73-
'com.mongodb.*',
74-
'reactor.core.*',
72+
'*',
7573
].join(',')
7674
}

driver-scala/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ ext {
100100
afterEvaluate {
101101
jar.manifest.attributes['Automatic-Module-Name'] = 'org.mongodb.scala.mongo-scala-driver'
102102
jar.manifest.attributes['Import-Package'] = [
103-
'org.bson.*',
104-
'com.mongodb.*',
103+
'!scala.*',
104+
'*'
105105
].join(',')
106106
}

driver-sync/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ afterEvaluate {
4646
jar.manifest.attributes['Automatic-Module-Name'] = 'org.mongodb.driver.sync.client'
4747
jar.manifest.attributes['Bundle-SymbolicName'] = 'org.mongodb.driver-sync'
4848
jar.manifest.attributes['Import-Package'] = [
49-
'org.bson.*',
5049
'com.mongodb.crypt.capi.*;resolution:=optional',
51-
'com.mongodb.*',
50+
'*',
5251
].join(',')
5352
}

0 commit comments

Comments
 (0)