Skip to content

Commit 2cfd77c

Browse files
authored
Add BouncyCastleRule rule class to deal with special LTS versioning (#226)
1 parent a4446d9 commit 2cfd77c

File tree

5 files changed

+153
-86
lines changed

5 files changed

+153
-86
lines changed

samples/sample-all/build.gradle.kts

+6-6
Original file line numberDiff line numberDiff line change
@@ -274,13 +274,13 @@ jvmDependencyConflicts {
274274
enforceSlf4JSimple()
275275
}
276276
conflictResolution {
277-
select(CapabilityDefinition.BOUNCYCASTLE_BCMAIL, "org.bouncycastle:bcmail-lts8on")
278-
select(CapabilityDefinition.BOUNCYCASTLE_BCPG, "org.bouncycastle:bcpg-lts8on")
279-
select(CapabilityDefinition.BOUNCYCASTLE_BCPKIX, "org.bouncycastle:bcpkix-lts8on")
280-
select(CapabilityDefinition.BOUNCYCASTLE_BCPROV, "org.bouncycastle:bcprov-lts8on")
281-
select(CapabilityDefinition.BOUNCYCASTLE_BCTLS, "org.bouncycastle:bctls-lts8on")
277+
select(CapabilityDefinition.BOUNCYCASTLE_BCMAIL, "org.bouncycastle:bcmail-jdk18on")
278+
select(CapabilityDefinition.BOUNCYCASTLE_BCPG, "org.bouncycastle:bcpg-jdk18on")
279+
select(CapabilityDefinition.BOUNCYCASTLE_BCPKIX, "org.bouncycastle:bcpkix-jdk18on")
280+
select(CapabilityDefinition.BOUNCYCASTLE_BCPROV, "org.bouncycastle:bcprov-jdk18on")
281+
select(CapabilityDefinition.BOUNCYCASTLE_BCTLS, "org.bouncycastle:bctls-jdk18on")
282282
select(CapabilityDefinition.BOUNCYCASTLE_BCTSP, "org.bouncycastle:bctsp-jdk15on")
283-
select(CapabilityDefinition.BOUNCYCASTLE_BCUTIL, "org.bouncycastle:bcutil-lts8on")
283+
select(CapabilityDefinition.BOUNCYCASTLE_BCUTIL, "org.bouncycastle:bcutil-jdk18on")
284284
select(CapabilityDefinition.CGLIB, "cglib:cglib")
285285
select(CapabilityDefinition.JAKARTA_SERVLET_API, "jakarta.servlet:jakarta.servlet-api")
286286
select(CapabilityDefinition.JAVAX_ACTIVATION_API, "javax.activation:javax.activation-api")

samples/sample-all/build.out

+72-73
Original file line numberDiff line numberDiff line change
@@ -205,84 +205,83 @@ compileClasspath - Compile classpath for source set 'main'.
205205
| +--- org.apache.commons:commons-lang3:3.17.0
206206
| \--- org.slf4j:slf4j-api:1.7.36 -> 2.0.17 (*)
207207
+--- org.apache.velocity:velocity:1.7 -> org.apache.velocity:velocity-engine-core:2.4.1 (*)
208-
+--- org.bouncycastle:bc-fips-debug:2.1.0 -> org.bouncycastle:bcprov-lts8on:2.73.7
209-
+--- org.bouncycastle:bc-fips:2.1.0 -> org.bouncycastle:bcprov-lts8on:2.73.7
210-
+--- org.bouncycastle:bcjmail-jdk15on:1.70 -> org.bouncycastle:bcmail-lts8on:2.73.7
211-
| \--- org.bouncycastle:bcpkix-lts8on:[2.73.7,2.74.0) -> 2.73.7
212-
| \--- org.bouncycastle:bcutil-lts8on:[2.73.7,2.74.0) -> 2.73.7
213-
| \--- org.bouncycastle:bcprov-lts8on:[2.73.7,2.74.0) -> 2.73.7
214-
+--- org.bouncycastle:bcjmail-jdk15to18:1.80 -> org.bouncycastle:bcmail-lts8on:2.73.7 (*)
215-
+--- org.bouncycastle:bcjmail-jdk18on:1.80 -> org.bouncycastle:bcmail-lts8on:2.73.7 (*)
216-
+--- org.bouncycastle:bcjmail-lts8on:2.73.7 -> org.bouncycastle:bcmail-lts8on:2.73.7 (*)
217-
+--- org.bouncycastle:bcmail-fips:2.1.6 -> org.bouncycastle:bcmail-lts8on:2.73.7 (*)
218-
+--- org.bouncycastle:bcmail-jdk14:1.80 -> org.bouncycastle:bcmail-lts8on:2.73.7 (*)
219-
+--- org.bouncycastle:bcmail-jdk15+:1.46 -> org.bouncycastle:bcmail-lts8on:2.73.7 (*)
220-
+--- org.bouncycastle:bcmail-jdk15:1.46 -> org.bouncycastle:bcmail-lts8on:2.73.7 (*)
221-
+--- org.bouncycastle:bcmail-jdk15on:1.70 -> org.bouncycastle:bcmail-lts8on:2.73.7 (*)
222-
+--- org.bouncycastle:bcmail-jdk15to18:1.80 -> org.bouncycastle:bcmail-lts8on:2.73.7 (*)
223-
+--- org.bouncycastle:bcmail-jdk16:1.46 -> org.bouncycastle:bcmail-lts8on:2.73.7 (*)
224-
+--- org.bouncycastle:bcmail-jdk18on:1.80 -> org.bouncycastle:bcmail-lts8on:2.73.7 (*)
225-
+--- org.bouncycastle:bcmail-lts8on:2.73.7 (*)
226-
+--- org.bouncycastle:bcpg-fips:2.1.11 -> org.bouncycastle:bcpg-lts8on:2.73.7
227-
| +--- org.bouncycastle:bcprov-lts8on:[2.73.7,2.74.0) -> 2.73.7
228-
| \--- org.bouncycastle:bcutil-lts8on:[2.73.7,2.74.0) -> 2.73.7 (*)
229-
+--- org.bouncycastle:bcpg-jdk12:130 -> org.bouncycastle:bcpg-lts8on:2.73.7 (*)
230-
+--- org.bouncycastle:bcpg-jdk14:1.80 -> org.bouncycastle:bcpg-lts8on:2.73.7 (*)
231-
+--- org.bouncycastle:bcpg-jdk15+:1.46 -> org.bouncycastle:bcpg-lts8on:2.73.7 (*)
232-
+--- org.bouncycastle:bcpg-jdk15:1.46 -> org.bouncycastle:bcpg-lts8on:2.73.7 (*)
233-
+--- org.bouncycastle:bcpg-jdk15on:1.70 -> org.bouncycastle:bcpg-lts8on:2.73.7 (*)
234-
+--- org.bouncycastle:bcpg-jdk15to18:1.80 -> org.bouncycastle:bcpg-lts8on:2.73.7 (*)
235-
+--- org.bouncycastle:bcpg-jdk16:1.46 -> org.bouncycastle:bcpg-lts8on:2.73.7 (*)
236-
+--- org.bouncycastle:bcpg-jdk18on:1.80 -> org.bouncycastle:bcpg-lts8on:2.73.7 (*)
237-
+--- org.bouncycastle:bcpg-lts8on:2.73.7 (*)
238-
+--- org.bouncycastle:bcpkix-fips:2.1.9 -> org.bouncycastle:bcpkix-lts8on:2.73.7 (*)
239-
+--- org.bouncycastle:bcpkix-jdk14:1.80 -> org.bouncycastle:bcpkix-lts8on:2.73.7 (*)
240-
+--- org.bouncycastle:bcpkix-jdk15on:1.70 -> org.bouncycastle:bcpkix-lts8on:2.73.7 (*)
241-
+--- org.bouncycastle:bcpkix-jdk15to18:1.80 -> org.bouncycastle:bcpkix-lts8on:2.73.7 (*)
242-
+--- org.bouncycastle:bcpkix-jdk18on:1.80 -> org.bouncycastle:bcpkix-lts8on:2.73.7 (*)
243-
+--- org.bouncycastle:bcpkix-lts8on:2.73.7 (*)
244-
+--- org.bouncycastle:bcprov-debug-jdk14:1.80 -> org.bouncycastle:bcprov-lts8on:2.73.7
245-
+--- org.bouncycastle:bcprov-debug-jdk15on:1.70 -> org.bouncycastle:bcprov-lts8on:2.73.7
246-
+--- org.bouncycastle:bcprov-debug-jdk15to18:1.79 -> org.bouncycastle:bcprov-lts8on:2.73.7
247-
+--- org.bouncycastle:bcprov-debug-jdk18on:1.79 -> org.bouncycastle:bcprov-lts8on:2.73.7
248-
+--- org.bouncycastle:bcprov-ext-debug-jdk14:1.74 -> org.bouncycastle:bcprov-lts8on:2.73.7
249-
+--- org.bouncycastle:bcprov-ext-debug-jdk15on:1.70 -> org.bouncycastle:bcprov-lts8on:2.73.7
250-
+--- org.bouncycastle:bcprov-ext-debug-jdk15to18:1.77 -> org.bouncycastle:bcprov-lts8on:2.73.7
251-
+--- org.bouncycastle:bcprov-ext-debug-jdk18on:1.77 -> org.bouncycastle:bcprov-lts8on:2.73.7
252-
+--- org.bouncycastle:bcprov-ext-jdk14:1.78.1 -> org.bouncycastle:bcprov-lts8on:2.73.7
253-
+--- org.bouncycastle:bcprov-ext-jdk15:1.46 -> org.bouncycastle:bcprov-lts8on:2.73.7
254-
+--- org.bouncycastle:bcprov-ext-jdk15on:1.70 -> org.bouncycastle:bcprov-lts8on:2.73.7
255-
+--- org.bouncycastle:bcprov-ext-jdk15to18:1.78.1 -> org.bouncycastle:bcprov-lts8on:2.73.7
256-
+--- org.bouncycastle:bcprov-ext-jdk16:1.46 -> org.bouncycastle:bcprov-lts8on:2.73.7
257-
+--- org.bouncycastle:bcprov-ext-jdk18on:1.78.1 -> org.bouncycastle:bcprov-lts8on:2.73.7
258-
+--- org.bouncycastle:bcprov-jdk12:130 -> org.bouncycastle:bcprov-lts8on:2.73.7
259-
+--- org.bouncycastle:bcprov-jdk14:1.80 -> org.bouncycastle:bcprov-lts8on:2.73.7
260-
+--- org.bouncycastle:bcprov-jdk15+:1.46 -> org.bouncycastle:bcprov-lts8on:2.73.7
261-
+--- org.bouncycastle:bcprov-jdk15:1.46 -> org.bouncycastle:bcprov-lts8on:2.73.7
262-
+--- org.bouncycastle:bcprov-jdk15on:1.70 -> org.bouncycastle:bcprov-lts8on:2.73.7
263-
+--- org.bouncycastle:bcprov-jdk15to18:1.80 -> org.bouncycastle:bcprov-lts8on:2.73.7
264-
+--- org.bouncycastle:bcprov-jdk16:1.46 -> org.bouncycastle:bcprov-lts8on:2.73.7
265-
+--- org.bouncycastle:bcprov-jdk18on:1.80 -> org.bouncycastle:bcprov-lts8on:2.73.7
266-
+--- org.bouncycastle:bcprov-lts8on:2.73.7
267-
+--- org.bouncycastle:bctls-fips:2.1.20 -> org.bouncycastle:bctls-lts8on:2.73.7
268-
| \--- org.bouncycastle:bcutil-lts8on:[2.73.7,2.74.0) -> 2.73.7 (*)
269-
+--- org.bouncycastle:bctls-jdk14:1.80 -> org.bouncycastle:bctls-lts8on:2.73.7 (*)
270-
+--- org.bouncycastle:bctls-jdk15on:1.70 -> org.bouncycastle:bctls-lts8on:2.73.7 (*)
271-
+--- org.bouncycastle:bctls-jdk15to18:1.80 -> org.bouncycastle:bctls-lts8on:2.73.7 (*)
272-
+--- org.bouncycastle:bctls-jdk18on:1.80 -> org.bouncycastle:bctls-lts8on:2.73.7 (*)
273-
+--- org.bouncycastle:bctls-lts8on:2.73.7 (*)
208+
+--- org.bouncycastle:bc-fips-debug:2.1.0 -> org.bouncycastle:bcprov-jdk18on:1.80
209+
+--- org.bouncycastle:bc-fips:2.1.0 -> org.bouncycastle:bcprov-jdk18on:1.80
210+
+--- org.bouncycastle:bcjmail-jdk15on:1.70 -> org.bouncycastle:bcmail-jdk18on:1.80
211+
| \--- org.bouncycastle:bcpkix-jdk18on:[1.80,1.81) -> 1.80
212+
| \--- org.bouncycastle:bcutil-jdk18on:[1.80,1.81) -> 1.80
213+
| \--- org.bouncycastle:bcprov-jdk18on:[1.80,1.81) -> 1.80
214+
+--- org.bouncycastle:bcjmail-jdk15to18:1.80 -> org.bouncycastle:bcmail-jdk18on:1.80 (*)
215+
+--- org.bouncycastle:bcjmail-jdk18on:1.80 -> org.bouncycastle:bcmail-jdk18on:1.80 (*)
216+
+--- org.bouncycastle:bcjmail-lts8on:2.73.7 -> org.bouncycastle:bcmail-jdk18on:1.80 (*)
217+
+--- org.bouncycastle:bcmail-fips:2.1.6 -> org.bouncycastle:bcmail-jdk18on:1.80 (*)
218+
+--- org.bouncycastle:bcmail-jdk14:1.80 -> org.bouncycastle:bcmail-jdk18on:1.80 (*)
219+
+--- org.bouncycastle:bcmail-jdk15+:1.46 -> org.bouncycastle:bcmail-jdk18on:1.80 (*)
220+
+--- org.bouncycastle:bcmail-jdk15:1.46 -> org.bouncycastle:bcmail-jdk18on:1.80 (*)
221+
+--- org.bouncycastle:bcmail-jdk15on:1.70 -> org.bouncycastle:bcmail-jdk18on:1.80 (*)
222+
+--- org.bouncycastle:bcmail-jdk15to18:1.80 -> org.bouncycastle:bcmail-jdk18on:1.80 (*)
223+
+--- org.bouncycastle:bcmail-jdk16:1.46 -> org.bouncycastle:bcmail-jdk18on:1.80 (*)
224+
+--- org.bouncycastle:bcmail-jdk18on:1.80 (*)
225+
+--- org.bouncycastle:bcmail-lts8on:2.73.7 -> org.bouncycastle:bcmail-jdk18on:1.80 (*)
226+
+--- org.bouncycastle:bcpg-fips:2.1.11 -> org.bouncycastle:bcpg-jdk18on:1.80
227+
| \--- org.bouncycastle:bcprov-jdk18on:[1.80,1.81) -> 1.80
228+
+--- org.bouncycastle:bcpg-jdk12:130 -> org.bouncycastle:bcpg-jdk18on:1.80 (*)
229+
+--- org.bouncycastle:bcpg-jdk14:1.80 -> org.bouncycastle:bcpg-jdk18on:1.80 (*)
230+
+--- org.bouncycastle:bcpg-jdk15+:1.46 -> org.bouncycastle:bcpg-jdk18on:1.80 (*)
231+
+--- org.bouncycastle:bcpg-jdk15:1.46 -> org.bouncycastle:bcpg-jdk18on:1.80 (*)
232+
+--- org.bouncycastle:bcpg-jdk15on:1.70 -> org.bouncycastle:bcpg-jdk18on:1.80 (*)
233+
+--- org.bouncycastle:bcpg-jdk15to18:1.80 -> org.bouncycastle:bcpg-jdk18on:1.80 (*)
234+
+--- org.bouncycastle:bcpg-jdk16:1.46 -> org.bouncycastle:bcpg-jdk18on:1.80 (*)
235+
+--- org.bouncycastle:bcpg-jdk18on:1.80 (*)
236+
+--- org.bouncycastle:bcpg-lts8on:2.73.7 -> org.bouncycastle:bcpg-jdk18on:1.80 (*)
237+
+--- org.bouncycastle:bcpkix-fips:2.1.9 -> org.bouncycastle:bcpkix-jdk18on:1.80 (*)
238+
+--- org.bouncycastle:bcpkix-jdk14:1.80 -> org.bouncycastle:bcpkix-jdk18on:1.80 (*)
239+
+--- org.bouncycastle:bcpkix-jdk15on:1.70 -> org.bouncycastle:bcpkix-jdk18on:1.80 (*)
240+
+--- org.bouncycastle:bcpkix-jdk15to18:1.80 -> org.bouncycastle:bcpkix-jdk18on:1.80 (*)
241+
+--- org.bouncycastle:bcpkix-jdk18on:1.80 (*)
242+
+--- org.bouncycastle:bcpkix-lts8on:2.73.7 -> org.bouncycastle:bcpkix-jdk18on:1.80 (*)
243+
+--- org.bouncycastle:bcprov-debug-jdk14:1.80 -> org.bouncycastle:bcprov-jdk18on:1.80
244+
+--- org.bouncycastle:bcprov-debug-jdk15on:1.70 -> org.bouncycastle:bcprov-jdk18on:1.80
245+
+--- org.bouncycastle:bcprov-debug-jdk15to18:1.79 -> org.bouncycastle:bcprov-jdk18on:1.80
246+
+--- org.bouncycastle:bcprov-debug-jdk18on:1.79 -> org.bouncycastle:bcprov-jdk18on:1.80
247+
+--- org.bouncycastle:bcprov-ext-debug-jdk14:1.74 -> org.bouncycastle:bcprov-jdk18on:1.80
248+
+--- org.bouncycastle:bcprov-ext-debug-jdk15on:1.70 -> org.bouncycastle:bcprov-jdk18on:1.80
249+
+--- org.bouncycastle:bcprov-ext-debug-jdk15to18:1.77 -> org.bouncycastle:bcprov-jdk18on:1.80
250+
+--- org.bouncycastle:bcprov-ext-debug-jdk18on:1.77 -> org.bouncycastle:bcprov-jdk18on:1.80
251+
+--- org.bouncycastle:bcprov-ext-jdk14:1.78.1 -> org.bouncycastle:bcprov-jdk18on:1.80
252+
+--- org.bouncycastle:bcprov-ext-jdk15:1.46 -> org.bouncycastle:bcprov-jdk18on:1.80
253+
+--- org.bouncycastle:bcprov-ext-jdk15on:1.70 -> org.bouncycastle:bcprov-jdk18on:1.80
254+
+--- org.bouncycastle:bcprov-ext-jdk15to18:1.78.1 -> org.bouncycastle:bcprov-jdk18on:1.80
255+
+--- org.bouncycastle:bcprov-ext-jdk16:1.46 -> org.bouncycastle:bcprov-jdk18on:1.80
256+
+--- org.bouncycastle:bcprov-ext-jdk18on:1.78.1 -> org.bouncycastle:bcprov-jdk18on:1.80
257+
+--- org.bouncycastle:bcprov-jdk12:130 -> org.bouncycastle:bcprov-jdk18on:1.80
258+
+--- org.bouncycastle:bcprov-jdk14:1.80 -> org.bouncycastle:bcprov-jdk18on:1.80
259+
+--- org.bouncycastle:bcprov-jdk15+:1.46 -> org.bouncycastle:bcprov-jdk18on:1.80
260+
+--- org.bouncycastle:bcprov-jdk15:1.46 -> org.bouncycastle:bcprov-jdk18on:1.80
261+
+--- org.bouncycastle:bcprov-jdk15on:1.70 -> org.bouncycastle:bcprov-jdk18on:1.80
262+
+--- org.bouncycastle:bcprov-jdk15to18:1.80 -> org.bouncycastle:bcprov-jdk18on:1.80
263+
+--- org.bouncycastle:bcprov-jdk16:1.46 -> org.bouncycastle:bcprov-jdk18on:1.80
264+
+--- org.bouncycastle:bcprov-jdk18on:1.80
265+
+--- org.bouncycastle:bcprov-lts8on:2.73.7 -> org.bouncycastle:bcprov-jdk18on:1.80
266+
+--- org.bouncycastle:bctls-fips:2.1.20 -> org.bouncycastle:bctls-jdk18on:1.80
267+
| \--- org.bouncycastle:bcutil-jdk18on:[1.80,1.81) -> 1.80 (*)
268+
+--- org.bouncycastle:bctls-jdk14:1.80 -> org.bouncycastle:bctls-jdk18on:1.80 (*)
269+
+--- org.bouncycastle:bctls-jdk15on:1.70 -> org.bouncycastle:bctls-jdk18on:1.80 (*)
270+
+--- org.bouncycastle:bctls-jdk15to18:1.80 -> org.bouncycastle:bctls-jdk18on:1.80 (*)
271+
+--- org.bouncycastle:bctls-jdk18on:1.80 (*)
272+
+--- org.bouncycastle:bctls-lts8on:2.73.7 -> org.bouncycastle:bctls-jdk18on:1.80 (*)
274273
+--- org.bouncycastle:bctsp-jdk14:1.46 -> org.bouncycastle:bctsp-jdk15on:1.46
275-
| +--- org.bouncycastle:bcprov-jdk15on:1.46 -> org.bouncycastle:bcprov-lts8on:2.73.7
276-
| \--- org.bouncycastle:bcmail-jdk15on:1.46 -> org.bouncycastle:bcmail-lts8on:2.73.7 (*)
274+
| +--- org.bouncycastle:bcprov-jdk15on:1.46 -> org.bouncycastle:bcprov-jdk18on:1.80
275+
| \--- org.bouncycastle:bcmail-jdk15on:1.46 -> org.bouncycastle:bcmail-jdk18on:1.80 (*)
277276
+--- org.bouncycastle:bctsp-jdk15+:1.46 -> org.bouncycastle:bctsp-jdk15on:1.46 (*)
278277
+--- org.bouncycastle:bctsp-jdk15:1.46 -> org.bouncycastle:bctsp-jdk15on:1.46 (*)
279278
+--- org.bouncycastle:bctsp-jdk15on:1.46 (*)
280279
+--- org.bouncycastle:bctsp-jdk16:1.46 -> org.bouncycastle:bctsp-jdk15on:1.46 (*)
281-
+--- org.bouncycastle:bcutil-jdk14:1.80 -> org.bouncycastle:bcutil-lts8on:2.73.7 (*)
282-
+--- org.bouncycastle:bcutil-jdk15on:1.70 -> org.bouncycastle:bcutil-lts8on:2.73.7 (*)
283-
+--- org.bouncycastle:bcutil-jdk15to18:1.80 -> org.bouncycastle:bcutil-lts8on:2.73.7 (*)
284-
+--- org.bouncycastle:bcutil-jdk18on:1.80 -> org.bouncycastle:bcutil-lts8on:2.73.7 (*)
285-
+--- org.bouncycastle:bcutil-lts8on:2.73.7 (*)
280+
+--- org.bouncycastle:bcutil-jdk14:1.80 -> org.bouncycastle:bcutil-jdk18on:1.80 (*)
281+
+--- org.bouncycastle:bcutil-jdk15on:1.70 -> org.bouncycastle:bcutil-jdk18on:1.80 (*)
282+
+--- org.bouncycastle:bcutil-jdk15to18:1.80 -> org.bouncycastle:bcutil-jdk18on:1.80 (*)
283+
+--- org.bouncycastle:bcutil-jdk18on:1.80 (*)
284+
+--- org.bouncycastle:bcutil-lts8on:2.73.7 -> org.bouncycastle:bcutil-jdk18on:1.80 (*)
286285
+--- org.codehaus.woodstox:woodstox-core-asl:4.4.1
287286
| +--- javax.xml.stream:stax-api:1.0-2 -> stax:stax-api:1.0.1
288287
| \--- org.codehaus.woodstox:stax2-api:3.1.4

src/main/java/org/gradlex/jvm/dependency/conflict/detection/rules/CapabilityDefinition.java

+8-7
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.gradlex.jvm.dependency.conflict.detection.rules;
1818

1919
import org.gradlex.jvm.dependency.conflict.detection.rules.aopalliance.AopallianceRule;
20+
import org.gradlex.jvm.dependency.conflict.detection.rules.bouncycastle.BouncyCastleRule;
2021
import org.gradlex.jvm.dependency.conflict.detection.rules.guava.GuavaListenableFutureRule;
2122
import org.gradlex.jvm.dependency.conflict.detection.rules.jakarta.JakartaActivationApiRule;
2223
import org.gradlex.jvm.dependency.conflict.detection.rules.jakarta.JakartaAnnotationApiRule;
@@ -69,7 +70,7 @@ public enum CapabilityDefinition {
6970
"asm:asm",
7071
"org.ow2.asm:asm"
7172
),
72-
BOUNCYCASTLE_BCMAIL(HIGHEST_VERSION,
73+
BOUNCYCASTLE_BCMAIL(HIGHEST_VERSION, BouncyCastleRule.class,
7374
"org.bouncycastle:bcmail-fips",
7475
"org.bouncycastle:bcmail-jdk14",
7576
"org.bouncycastle:bcmail-jdk15",
@@ -84,7 +85,7 @@ public enum CapabilityDefinition {
8485
"org.bouncycastle:bcjmail-jdk18on",
8586
"org.bouncycastle:bcjmail-lts8on"
8687
),
87-
BOUNCYCASTLE_BCPG(HIGHEST_VERSION,
88+
BOUNCYCASTLE_BCPG(HIGHEST_VERSION, BouncyCastleRule.class,
8889
"org.bouncycastle:bcpg-fips",
8990
"org.bouncycastle:bcpg-jdk12",
9091
"org.bouncycastle:bcpg-jdk14",
@@ -96,15 +97,15 @@ public enum CapabilityDefinition {
9697
"org.bouncycastle:bcpg-jdk18on",
9798
"org.bouncycastle:bcpg-lts8on"
9899
),
99-
BOUNCYCASTLE_BCPKIX(HIGHEST_VERSION,
100+
BOUNCYCASTLE_BCPKIX(HIGHEST_VERSION, BouncyCastleRule.class,
100101
"org.bouncycastle:bcpkix-fips",
101102
"org.bouncycastle:bcpkix-jdk14",
102103
"org.bouncycastle:bcpkix-jdk15on",
103104
"org.bouncycastle:bcpkix-jdk15to18",
104105
"org.bouncycastle:bcpkix-jdk18on",
105106
"org.bouncycastle:bcpkix-lts8on"
106107
),
107-
BOUNCYCASTLE_BCPROV(HIGHEST_VERSION,
108+
BOUNCYCASTLE_BCPROV(HIGHEST_VERSION, BouncyCastleRule.class,
108109
"org.bouncycastle:bcprov-debug-jdk14",
109110
"org.bouncycastle:bcprov-debug-jdk15on",
110111
"org.bouncycastle:bcprov-debug-jdk15to18",
@@ -131,22 +132,22 @@ public enum CapabilityDefinition {
131132
"org.bouncycastle:bc-fips",
132133
"org.bouncycastle:bc-fips-debug"
133134
),
134-
BOUNCYCASTLE_BCTLS(HIGHEST_VERSION,
135+
BOUNCYCASTLE_BCTLS(HIGHEST_VERSION, BouncyCastleRule.class,
135136
"org.bouncycastle:bctls-jdk14",
136137
"org.bouncycastle:bctls-jdk15on",
137138
"org.bouncycastle:bctls-jdk15to18",
138139
"org.bouncycastle:bctls-jdk18on",
139140
"org.bouncycastle:bctls-lts8on",
140141
"org.bouncycastle:bctls-fips"
141142
),
142-
BOUNCYCASTLE_BCTSP(HIGHEST_VERSION,
143+
BOUNCYCASTLE_BCTSP(HIGHEST_VERSION, BouncyCastleRule.class,
143144
"org.bouncycastle:bctsp-jdk14",
144145
"org.bouncycastle:bctsp-jdk15",
145146
"org.bouncycastle:bctsp-jdk15+",
146147
"org.bouncycastle:bctsp-jdk15on",
147148
"org.bouncycastle:bctsp-jdk16"
148149
),
149-
BOUNCYCASTLE_BCUTIL(HIGHEST_VERSION,
150+
BOUNCYCASTLE_BCUTIL(HIGHEST_VERSION, BouncyCastleRule.class,
150151
"org.bouncycastle:bcutil-jdk14",
151152
"org.bouncycastle:bcutil-jdk15on",
152153
"org.bouncycastle:bcutil-jdk15to18",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright the GradleX team.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.gradlex.jvm.dependency.conflict.detection.rules.bouncycastle;
18+
19+
import org.gradle.api.artifacts.CacheableRule;
20+
import org.gradle.api.artifacts.ModuleVersionIdentifier;
21+
import org.gradlex.jvm.dependency.conflict.detection.rules.CapabilityDefinition;
22+
import org.gradlex.jvm.dependency.conflict.detection.rules.CapabilityDefinitionRule;
23+
24+
import javax.inject.Inject;
25+
26+
@CacheableRule
27+
public abstract class BouncyCastleRule extends CapabilityDefinitionRule {
28+
29+
@Inject
30+
public BouncyCastleRule(CapabilityDefinition rule) {
31+
super(rule);
32+
}
33+
34+
@Override
35+
protected String getVersion(ModuleVersionIdentifier id) {
36+
// The 2.x LTS versions correspond to the 1.x non-lts versions
37+
String version = id.getVersion();
38+
if (id.getName().contains("-lts") && version.startsWith("2.")) {
39+
return "1." + version.substring(2);
40+
}
41+
if (!version.contains(".")) {
42+
// Weird version: bcprov-jdk12:130
43+
return "1.0";
44+
}
45+
return super.getVersion(id);
46+
}
47+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright the GradleX team.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
@NonNullApi
18+
package org.gradlex.jvm.dependency.conflict.detection.rules.bouncycastle;
19+
20+
import org.gradle.api.NonNullApi;

0 commit comments

Comments
 (0)