bcgit / bc-java

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

Publish relocation POM from `jdk15on` -> `jdk18on` #1289

Open Marcono1234 opened 1 year ago

Marcono1234 commented 1 year ago

Hello,

what do you think about publishing a relocation POM to let users of the jdk15on artifacts know that they should upgrade to the jdk18on artifacts?

A relocation POM works like this: You publish artifacts under the old coordinates (jdk15on) which only consist of a pom.xml with relocation information, no JARs are included. The relocation information then points to the new artifact. For example for bcprov-jdk15on you could publish a version 1.71 whose pom.xml contains:

<relocation>
   <artifactId>bcprov-jdk18on</artifactId>
   <message>Bouncy Castle now requires Java 8 or newer; use version jdk15to18 for older Java versions</message>
</relocation>

(groupId and version can be omitted because they are the same as the old artifact)

This would then point users of bcprov-jdk15on:1.71 to bcprov-jdk18on:1.71.

The advantage is that relocation information is supported by many tools in the Maven ecosystem. For example Maven emits a warning when you specify a dependency on the relocation POM (e.g. bcprov-jdk15on:1.71), informing you that the artifact has moved. And sites such as https://mvnrepository.com provide information as well, e.g. on https://mvnrepository.com/artifact/ant/ant ("Note: This artifact was moved to ...")

Though note that I am not that experienced with relocation yet, so feel free to consult someone more familiar.

vlsi commented 1 year ago

There might be a need to fix security issues in jdk15on, so I'm afraid adding a relocation is not an option.

Marcono1234 commented 1 year ago

Good point. Though unfortunately without relocation information it would make it more difficult / impossible to automatically discover the change of the Maven coordinates, so users would remain on jdk15on 1.70 unless they manually search for updates (and notice the coodinates change).

I will leave it up to the maintainers to close this issue in case they don't want to publish relocation information.

dghgit commented 1 year ago

Actually it would need to point at 15to18 as well, which for a lot of people wouldn't be correct either (they'd be better off moving to 18on...) I'll look up the details on this but I think we might be between a rock and a hard place on this one.