Skip to content

Commit 2a720e2

Browse files
authored
Merge pull request #18 from nats-io/upgrade
Split and Upgrade
2 parents 7cf8d0f + fa94a7c commit 2a720e2

File tree

86 files changed

+5772
-1778
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+5772
-1778
lines changed

.github/workflows/build-main.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/build-pr.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/build-release.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/core-main.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Core Main Snapshot
2+
permissions:
3+
contents: read
4+
on:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- 'core/**'
10+
11+
jobs:
12+
build:
13+
strategy:
14+
matrix:
15+
tc: [ 8, 17, 21, 25 ]
16+
runs-on: ubuntu-latest
17+
defaults:
18+
run:
19+
working-directory: ./core
20+
env:
21+
BUILD_EVENT: ${{ github.event_name }}
22+
TARGET_COMPATIBILITY: ${{ matrix.tc }}
23+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
24+
OSSRH_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
25+
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
26+
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
27+
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
28+
steps:
29+
- name: Set up JDK
30+
uses: actions/setup-java@v5
31+
with:
32+
java-version: 25
33+
distribution: 'temurin'
34+
- name: Setup Gradle
35+
uses: gradle/actions/setup-gradle@v5
36+
with:
37+
gradle-version: current
38+
- name: Check out code
39+
uses: actions/checkout@v4
40+
- name: Build and Test
41+
run: chmod +x gradlew && ./gradlew clean test jacocoTestReport
42+
- name: Verify Javadoc
43+
run: ./gradlew javadoc
44+
- name: Send coverage to Coveralls
45+
uses: coverallsapp/github-action@v2
46+
with:
47+
github-token: ${{ secrets.COVERALLS_REPO_TOKEN }}
48+
parallel: true
49+
flag-name: tc${{ matrix.tc }}
50+
- name: Publish Snapshot
51+
run: ./gradlew -i publishToSonatype
52+
53+
coveralls-finish:
54+
needs: build
55+
runs-on: ubuntu-latest
56+
defaults:
57+
run:
58+
working-directory: ./core
59+
steps:
60+
- name: Coveralls Finish
61+
uses: coverallsapp/github-action@v2
62+
with:
63+
github-token: ${{ secrets.GITHUB_TOKEN }}
64+
parallel-finished: true
65+
carryforward: "tc8"

.github/workflows/core-pr.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Core Pull Request
2+
permissions:
3+
contents: read
4+
on:
5+
pull_request:
6+
types: [opened, synchronize, reopened]
7+
paths:
8+
- 'core/**'
9+
10+
jobs:
11+
build:
12+
strategy:
13+
matrix:
14+
tc: [ 8, 17, 21, 25 ]
15+
runs-on: ubuntu-latest
16+
defaults:
17+
run:
18+
working-directory: ./core
19+
env:
20+
BUILD_EVENT: ${{ github.event_name }}
21+
TARGET_COMPATIBILITY: ${{ matrix.tc }}
22+
steps:
23+
- name: Set up JDK
24+
uses: actions/setup-java@v5
25+
with:
26+
java-version: 25
27+
distribution: 'temurin'
28+
- name: Setup Gradle
29+
uses: gradle/actions/setup-gradle@v5
30+
with:
31+
gradle-version: current
32+
- name: Check out code
33+
uses: actions/checkout@v4
34+
- name: Build and Test
35+
run: chmod +x gradlew && ./gradlew clean test jacocoTestReport
36+
- name: Verify Javadoc
37+
run: ./gradlew javadoc
38+
- name: Send coverage to Coveralls
39+
uses: coverallsapp/github-action@v2
40+
with:
41+
github-token: ${{ secrets.COVERALLS_REPO_TOKEN }}
42+
parallel: true
43+
flag-name: tc${{ matrix.tc }}
44+
45+
coveralls-finish:
46+
needs: build
47+
runs-on: ubuntu-latest
48+
defaults:
49+
run:
50+
working-directory: ./core
51+
steps:
52+
- name: Coveralls Finish
53+
uses: coverallsapp/github-action@v2
54+
with:
55+
github-token: ${{ secrets.GITHUB_TOKEN }}
56+
parallel-finished: true
57+
carryforward: "tc8"

.github/workflows/core-release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Core Publish Release
2+
permissions:
3+
contents: read
4+
on:
5+
push:
6+
tags: [ 'core/*' ]
7+
8+
jobs:
9+
build:
10+
strategy:
11+
matrix:
12+
tc: [ 8, 17, 21, 25 ]
13+
runs-on: ubuntu-latest
14+
defaults:
15+
run:
16+
working-directory: ./core
17+
env:
18+
BUILD_EVENT: "release"
19+
TARGET_COMPATIBILITY: ${{ matrix.tc }}
20+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
21+
OSSRH_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
22+
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
23+
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
24+
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
25+
steps:
26+
- name: Set up JDK
27+
uses: actions/setup-java@v5
28+
with:
29+
java-version: 25
30+
distribution: 'temurin'
31+
- name: Setup Gradle
32+
uses: gradle/actions/setup-gradle@v5
33+
with:
34+
gradle-version: current
35+
- name: Check out code
36+
uses: actions/checkout@v4
37+
- name: Build, Sign and Publish Release
38+
run: chmod +x gradlew && ./gradlew clean compileJava publishToSonatype closeAndReleaseSonatypeStagingRepository

README.md

Lines changed: 98 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44

55
The library allows you to create and use NKEYS in Java code.
66

7-
**Current Release**: 2.1.1   **Current Snapshot**: 2.1.2-SNAPSHOT
7+
![3.0.0](https://img.shields.io/badge/Current_Release-3.0.0-27AAE0?style=for-the-badge)
8+
![3.0.1](https://img.shields.io/badge/Current_Snapshot-3.0.1--SNAPSHOT-27AAE0?style=for-the-badge)
89

9-
[![License Apache 2](https://img.shields.io/badge/License-Apache2-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
10-
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.nats/nkeys-java/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.nats/nkeys-java)
11-
[![Javadoc](http://javadoc.io/badge/io.nats/nkeys-java.svg?branch=main)](http://javadoc.io/doc/io.nats/nkeys-java?branch=main)
12-
[![Coverage Status](https://coveralls.io/repos/github/nats-io/nkeys.java/badge.svg?branch=main)](https://coveralls.io/github/nats-io/nkeys.java?branch=main)
1310
[![Build Main Badge](https://github.com/nats-io/nkeys.java/actions/workflows/build-main.yml/badge.svg?event=push)](https://github.com/nats-io/nkeys.java/actions/workflows/build-main.yml)
14-
[![Release Badge](https://github.com/nats-io/nkeys.java/actions/workflows/build-release.yml/badge.svg?event=release)](https://github.com/nats-io/nkeys.java/actions/workflows/build-release.yml)
11+
[![Coverage Status](https://coveralls.io/repos/github/nats-io/nkeys.java/badge?branch=main)](https://coveralls.io/github/nats-io/nkeys.java?branch=main)
12+
[![Maven JDK 21](https://img.shields.io/maven-central/v/io.nats/nkeys-java-jdk21?label=maven-central-jdk21)](https://mvnrepository.com/artifact/io.nats/nkeys-java-jdk21)
13+
[![Maven JDK 25](https://img.shields.io/maven-central/v/io.nats/nkeys-java-jdk25?label=maven-central-jdk25)](https://mvnrepository.com/artifact/io.nats/nkeys-java-jdk25)
14+
[![Javadoc](http://javadoc.io/badge/io.nats/nkeys-java-jdk21.svg?branch=main)](http://javadoc.io/doc/io.nats/nkeys-java-jdk21?branch=main)
15+
[![License Apache 2](https://img.shields.io/badge/License-Apache2-blue)](https://www.apache.org/licenses/LICENSE-2.0)
1516

1617
# Overview
1718

@@ -62,7 +63,97 @@ The NATS system will utilize public NKeys for identification, the NATS system
6263
will never store or even have access to any private keys or seeds.
6364
Authentication will utilize a challenge-response mechanism based on a
6465
collection of random bytes called a nonce.
65-
66+
### JDK Version
67+
68+
This project uses Java 21 Language Level api, but builds with both Java 21 and Java 25, so creates two different artifacts.
69+
Both have the same group id `io.nats`, and the same version but have different artifact names.
70+
71+
* The Java 21 artifact id is `nkeys-java-jdk21`
72+
* The Java 25 artifact id is `nkeys-java-jdk25`
73+
74+
### Dependency Management
75+
76+
The NATS client is available in the Maven central repository,
77+
and can be imported as a standard dependency in your `build.gradle` or `pom.xml` file,
78+
The examples shown use the jdk 21 version, to the jdk 25 version just change the artifact id.
79+
80+
#### Gradle
81+
82+
```groovy
83+
dependencies {
84+
implementation 'io.nats:nkeys-java-jdk21:3.0.0'
85+
}
86+
```
87+
88+
If you need the latest and greatest before Maven central updates, you can use:
89+
90+
```groovy
91+
repositories {
92+
mavenCentral()
93+
maven {
94+
url "https://repo1.maven.org/maven2/"
95+
}
96+
}
97+
```
98+
99+
If you need a snapshot version, you must add the url for the snapshots and change your dependency.
100+
101+
```groovy
102+
repositories {
103+
mavenCentral()
104+
maven {
105+
url "https://central.sonatype.com/repository/maven-snapshots"
106+
}
107+
}
108+
109+
dependencies {
110+
implementation 'io.nats:nkeys-java-jdk21:3.0.1-SNAPSHOT'
111+
}
112+
```
113+
114+
#### Maven
115+
116+
```xml
117+
<dependency>
118+
<groupId>io.nats</groupId>
119+
<artifactId>nkeys-java-jdk21</artifactId>
120+
<version>3.0.0</version>
121+
</dependency>
122+
```
123+
124+
If you need the absolute latest, before it propagates to maven central, you can use the repository:
125+
126+
```xml
127+
<repositories>
128+
<repository>
129+
<id>sonatype releases</id>
130+
<url>https://repo1.maven.org/maven2/</url>
131+
<releases>
132+
<enabled>true</enabled>
133+
</releases>
134+
</repository>
135+
</repositories>
136+
```
137+
138+
If you need a snapshot version, you must enable snapshots and change your dependency.
139+
140+
```xml
141+
<repositories>
142+
<repository>
143+
<id>sonatype snapshots</id>
144+
<url>https://central.sonatype.com/repository/maven-snapshots</url>
145+
<snapshots>
146+
<enabled>true</enabled>
147+
</snapshots>
148+
</repository>
149+
</repositories>
150+
151+
<dependency>
152+
<groupId>io.nats</groupId>
153+
<artifactId>nkeys-java-jdk21</artifactId>
154+
<version>3.0.1-SNAPSHOT</version>
155+
</dependency>
156+
```
66157

67158
## License
68159

0 commit comments

Comments
 (0)