Skip to content

Commit 5a1448f

Browse files
authored
[Maintenance] Fix bc-fips jar hell by marking dependency as compileOnly (#5158)
* [maintenance] Fix bc-fips jar hell by marking dependency as compileOnly Signed-off-by: Jialiang Liang <jiallian@amazon.com> * add fix for tests Signed-off-by: Jialiang Liang <jiallian@amazon.com> --------- Signed-off-by: Jialiang Liang <jiallian@amazon.com>
1 parent 1e3c249 commit 5a1448f

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

datasources/build.gradle

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import org.opensearch.gradle.info.FipsBuildParams
7-
86
plugins {
97
id 'java-library'
108
id "io.freefair.lombok"
@@ -28,12 +26,10 @@ dependencies {
2826
implementation ('com.amazonaws:aws-encryption-sdk-java:2.4.1') {
2927
exclude group: 'org.bouncycastle', module: 'bcprov-ext-jdk18on'
3028
}
31-
// When building with -Pcrypto.standard=FIPS-140-3, bcFips jars are provided by OpenSearch
32-
if (FipsBuildParams.isInFipsMode()) {
33-
compileOnly "org.bouncycastle:bc-fips:${versions.bouncycastle_jce}"
34-
} else {
35-
implementation "org.bouncycastle:bc-fips:${versions.bouncycastle_jce}"
36-
}
29+
30+
// bc-fips is provided by OpenSearch core at runtime since opensearch 3.6.0
31+
compileOnly "org.bouncycastle:bc-fips:${versions.bouncycastle_jce}"
32+
testImplementation "org.bouncycastle:bc-fips:${versions.bouncycastle_jce}"
3733

3834
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
3935
testImplementation('org.junit.jupiter:junit-jupiter:5.9.3')

0 commit comments

Comments
 (0)