Repository navigation
One Gradle build, OSGi bundles, one-provider capability, Bouncy Castle upgrade - #33
Conversation
…e upgrade
- One multi-project build (core, regular, lts, fips) with one wrapper and
the shared module build in gradle/nkeys-module.gradle; one version in
gradle.properties. Implementations depend on project(':core'), so core
and implementations release together at one version.
- OSGi: core has the symbolic name io.nats.nkeys.core and exports
io.nats.nkey; regular, lts and fips are fragments of it, since they
share the package and NKeyProvider loads the provider by name.
- Implementations publish the capability io.nats.nkeys:nkey-provider, so
Gradle fails resolution when two are in one build. README note added.
- bcprov-lts8on 2.73.13, bcprov-jdk18on 1.86 (bc-fips 2.1.3 is latest).
- --release per target JDK, javadoc errors fail the build, JUnit BOM
5.14.1, mavenCentral only, unused bundle task removed.
- Workflows: build-pr, build-main, build-release (GitHub release event)
replace the 10 per-module workflows.
|
Claude finished @scottf's task in 3m 4s —— View job Review complete
This PR touches only build/CI infrastructure ( Bug found: Things that check out:
|
| release: | ||
| branches: | ||
| - main | ||
| types: [released] |
There was a problem hiding this comment.
release is not among the GitHub Actions events that support a branches filter (only push, pull_request, pull_request_target, merge_group, workflow_run do; release only supports types). An unsupported key like this typically makes the whole workflow file invalid, so this workflow would never run on an actual GitHub release — silently breaking the new single-release publish process this PR is built around.
| release: | |
| branches: | |
| - main | |
| types: [released] | |
| release: | |
| types: [released] |
There was a problem hiding this comment.
Not changing this: the trigger is valid and has not broken any workflow.
nats-io/jnats-json uses exactly the same trigger in build-release.yml (release: with branches: [main] and types: [released]), and that workflow ran successfully on each of its last 5 releases (3.0.6 through 3.1.0, event release). nats-io/nats.java and nats-io/java-nats-server-runner use the same trigger in their release workflows. So an unsupported branches key under release does not invalidate the file.
GitHub does not filter release events by branch, so the branches key has no effect. It is kept for consistency with the other repos.
OSGi. The jars were OSGi bundles, but nothing exported
io.nats.nkey, and the symbolic names were the genericcore,lts,fips,regular. Now:Bundle-SymbolicName: io.nats.nkeys.core, exportsio.nats.nkey.io.nats.nkeys.core(io.nats.nkeys.regular/.lts/.fips). They put classes in core's package, andNKeyProviderloads the provider class by name through core's class loader, so they have to share core's class loader.One provider. The implementations contain classes with the same names in the same package (
PrivateKeyWrapper,PublicKeyWrapper), so two on a classpath break at runtime. Each implementation now publishes the Gradle capabilityio.nats.nkeys:nkey-provider; a Gradle build that pulls in two fails withCannot select module with conflict on capability 'io.nats.nkeys:nkey-provider'. Maven does not read this metadata, so the README now says to use exactly one implementation.One Gradle build.
settings.gradle/build.gradle/gradle.propertiesand one wrapper replace four independent builds. The shared module build isgradle/nkeys-module.gradle; each module'sbuild.gradleis its description and its Bouncy Castle dependency.project(':core')instead of a pinned published core. The published POM and module metadata depend oncore-jdk<tc>at the same version, so core and implementations release together at one version.core-jdk17...fips-jdk25).options.releaseis the target JDK; javadoc errors fail the build; JUnit BOM 5.14.1;mavenCentral()only; the unusedbundletask is removed.build-pr.yml,build-main.yml,build-release.yml(runs on a GitHub release, as in jnats-json) replace the 10 per-module workflows. Release process change: thecore/*andimpl/*tags are no longer used; one GitHub release publishes all modules.Bouncy Castle.
bcprov-lts8on2.73.12.1 → 2.73.13,bcprov-jdk18on1.85.2 → 1.86.bc-fips2.1.3 is already the latest.dependencies.mdupdated.Verified locally with JDK 21:
clean build javadocfor targets 17 and 21 (core 34, regular 21, lts 22, fips 21 tests, all pass; class file versions 61 and 65). Published to a temporary Maven repo and resolved from a consumer build (one implementation resolves; two fail with the capability conflict). In Apache Felix 7.0.5, core + the lts fragment + bcprov-lts8on 2.73.13 + jnats-json (nats-io/jnats-json#40) + the jnats V3 bundles resolve;NKeyProvider.getProvider("io.nats.nkey.LtsNKeyProvider")creates a user key. Target 25 is built by CI only.🤖 Generated with Claude Code