diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 587a755..20a233b 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -11,6 +11,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
+ - name: Cache local Maven repository
+ uses: actions/cache@v4
+ with:
+ path: ~/.m2/repository
+ key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: |
+ ${{ runner.os }}-maven-
- name: Set up Java
uses: actions/setup-java@v4
with:
@@ -18,4 +25,4 @@ jobs:
distribution: 'temurin'
- name: Build with Maven
- run: mvn clean package
+ run: mvn -B clean package
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 564a6b2..a95a9d8 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -1,4 +1,4 @@
-name: Publish to GitHub Packages
+name: Publish
on:
push:
@@ -13,16 +13,30 @@ jobs:
packages: write
steps:
- uses: actions/checkout@v4
+ - name: Cache local Maven repository
+ uses: actions/cache@v4
+ with:
+ path: ~/.m2/repository
+ key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: |
+ ${{ runner.os }}-maven-
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '23'
distribution: 'temurin'
+ server-id: central
+ server-username: MAVEN_USERNAME
+ server-password: MAVEN_PASSWORD
+ gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
+ gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Build with Maven
- run: mvn clean package
+ run: mvn -B clean package
- - name: Publish to GitHub Packages
- run: mvn deploy
+ - name: Publish to Maven Central
+ run: mvn -B deploy -P central
env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
+ MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
+ MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
diff --git a/README.md b/README.md
index cd3d169..148d4b2 100644
--- a/README.md
+++ b/README.md
@@ -9,27 +9,15 @@ Check out our [Spring AI Example](https://langfuse.com/docs/integrations/spring-
## Installation
-Add the langfuse-java API client as a dependency using
+The recommended way to install the langfuse-java API client is via Maven Central:
+
```xml
com.langfuse
langfuse-java
- 0.0.1-SNAPSHOT
+ 0.0.4
```
-to fetch our [GitHub package](https://github.com/langfuse/langfuse-java/packages/2423464).
-
-If you're not scanning the GitHub Package Registry by default, you'll have to add
-```xml
-
-
- github
- GitHub Package Registry
- https://maven.pkg.github.com/langfuse/langfuse-java
-
-
-```
-as well.
## Usage
@@ -65,6 +53,16 @@ try {
Run `./mvnw release:prepare -DreleaseVersion=` with the version you want to create.
Push the changes including the tag.
+## Publishing to Maven Central
+
+This project is configured to publish to Maven Central.
+To publish to Maven Central, you need to configure the following secrets in your GitHub repository:
+
+- `OSSRH_USERNAME`: Your Sonatype OSSRH username
+- `OSSRH_PASSWORD`: Your Sonatype OSSRH password
+- `GPG_PRIVATE_KEY`: Your GPG private key for signing artifacts
+- `GPG_PASSPHRASE`: The passphrase for your GPG private key
+
## Updating
1. Ensure that langfuse-java is placed in the same directory as the main [langfuse](https://github.com/langfuse/langfuse) repository.
diff --git a/pom.xml b/pom.xml
index d181e29..f7b02d8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,12 +7,32 @@
jar
langfuse-java
+ Java client for the Langfuse API
https://langfuse.com
+
+
+ MIT License
+ https://opensource.org/licenses/MIT
+ repo
+
+
+
+
+
+ Langfuse Team
+ support@langfuse.com
+ Langfuse
+ https://langfuse.com
+
+
+
scm:git:https://github.com/langfuse/langfuse-java.git
- HEAD
-
+ scm:git:https://github.com/langfuse/langfuse-java.git
+ https://github.com/langfuse/langfuse-java
+ HEAD
+
UTF-8
@@ -21,13 +41,83 @@
5.9.3
-
-
- github
- GitHub Packages
- https://maven.pkg.github.com/langfuse/langfuse-java
-
-
+
+
+ central
+
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ 3.1.0
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
+ --pinentry-mode
+ loopback
+
+
+
+
+
+
+
+
+ org.sonatype.central
+ central-publishing-maven-plugin
+ 0.7.0
+ true
+
+ central
+ true
+
+
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 3.3.0
+
+
+ attach-sources
+
+ jar-no-fork
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 3.6.3
+
+
+ attach-javadocs
+
+ jar
+
+
+
+
+
+