bcgit / bc-java

Bouncy Castle Java Distribution (Mirror)
https://www.bouncycastle.org/java.html
MIT License
2.33k stars 1.14k forks source link

Add BOM #1915

Open runeflobakk opened 1 week ago

runeflobakk commented 1 week ago

I have taken a stab at trying to fix #899. This will add a new subproject to produce a BOM which includes all the other subprojects and their versions. The published BOM can be declared in <dependencyManagement> in a pom.xml like this:

<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bc-bom-jdk18on</artifactId>
    <version>1.80-SNAPSHOT</version> <!-- Replace with release version -->
    <type>pom</type>
    <scope>import</scope>
</dependency>

And this will ensure all BouncyCastle artifacts included in the dependency graph to be managed to the same version, even though you may not explicitly depend on them in your project, and your dependencies may themselves depend on different BouncyCastle artifacts and versions. Example:

m2e-dependency-hierarchy
Resulting published POM

(Omitted the various XML declarations for brevity)

```xml 4.0.0 org.bouncycastle bc-bom-jdk18on 1.80-SNAPSHOT pom org.bouncycastle bccore-jdk18on 1.80-SNAPSHOT org.bouncycastle bcutil-jdk18on 1.80-SNAPSHOT org.bouncycastle bcpg-jdk18on 1.80-SNAPSHOT org.bouncycastle bcpkix-jdk18on 1.80-SNAPSHOT org.bouncycastle bcprov-jdk18on 1.80-SNAPSHOT org.bouncycastle bctls-jdk18on 1.80-SNAPSHOT bouncycastle test 1.80-SNAPSHOT org.bouncycastle bcmls-jdk18on 1.80-SNAPSHOT org.bouncycastle bcmail-jdk18on 1.80-SNAPSHOT org.bouncycastle bcjmail-jdk18on 1.80-SNAPSHOT ```

Questions

This is the first time I have done anything remotely involved with Gradle, so there may be better way to achieve this.