Skip to content

feat(jni): Maven distribution of the Java API on GitHub Packages - #618

Merged
andiwand merged 1 commit into
mainfrom
maven-dist
Jul 26, 2026
Merged

feat(jni): Maven distribution of the Java API on GitHub Packages#618
andiwand merged 1 commit into
mainfrom
maven-dist

Conversation

@andiwand

@andiwand andiwand commented Jul 25, 2026

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

Stacked on #617.

Publishes the JNI Java API (jni/java, package app.opendocument.core) as a Maven package app.opendocument:odr-core-java to GitHub Packages.

Scope

Java classes only — the artifact deliberately contains no native binaries and no assets. Consumers (odr.droid) keep building libodr_jni for their target platform via their existing Conan/NDK machinery and add the Java API as a plain Gradle dependency.

Changes

  • jni/pom.xml — Maven build of jni/java (--release 17 -Xlint:all, kept in sync with CMAKE_JAVA_COMPILE_FLAGS); attaches sources + javadoc jars; CI-friendly versioning via -Drevision with flatten-maven-plugin so the deployed POM carries the resolved version; distributionManagement points at GitHub Packages.
  • .github/workflows/maven.ymlmvn verify on push; mvn deploy on published release (version from the v* tag, like the conan publish workflow) and on workflow_dispatch with an explicit version for test publishes. Uses the built-in GITHUB_TOKEN (packages: write) — no secrets to configure.
  • jni/README.md — consumption snippet (GitHub Packages needs a read:packages token even for public packages).

Verification

Local mvn verify builds the jar + sources + javadoc jars cleanly (no javadoc/lint warnings); the flattened POM resolves the version placeholder.

An end-to-end test publish can be done once this lands anywhere: gh workflow run maven.yml --ref <branch> -f version=0.0.1-test1.

https://claude.ai/code/session_01Gffw8AurchbpS1rL3kWwBd

Base automatically changed from jni-bindings to main July 26, 2026 06:48
Publish app.opendocument:odr-core-java (Java classes only, plus sources
and javadoc jars) to GitHub Packages on release. The native odr_jni
library stays out of the artifact; consumers build it for their target
platform.

- jni/pom.xml: CI-friendly version via -Drevision, flattened POM
- .github/workflows/maven.yml: verify on push, deploy on release
  (and workflow_dispatch for test publishes)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gffw8AurchbpS1rL3kWwBd
@andiwand
andiwand enabled auto-merge (squash) July 26, 2026 06:51
@andiwand
andiwand merged commit 25af538 into main Jul 26, 2026
22 checks passed
@andiwand
andiwand deleted the maven-dist branch July 26, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant