|
4 | 4 |
|
5 | 5 | The library allows you to create and use NKEYS in Java code. |
6 | 6 |
|
7 | | -**Current Release**: 2.1.1 **Current Snapshot**: 2.1.2-SNAPSHOT |
| 7 | + |
| 8 | + |
8 | 9 |
|
9 | | -[](https://www.apache.org/licenses/LICENSE-2.0) |
10 | | -[](https://maven-badges.herokuapp.com/maven-central/io.nats/nkeys-java) |
11 | | -[](http://javadoc.io/doc/io.nats/nkeys-java?branch=main) |
12 | | -[](https://coveralls.io/github/nats-io/nkeys.java?branch=main) |
13 | 10 | [](https://github.com/nats-io/nkeys.java/actions/workflows/build-main.yml) |
14 | | -[](https://github.com/nats-io/nkeys.java/actions/workflows/build-release.yml) |
| 11 | +[](https://coveralls.io/github/nats-io/nkeys.java?branch=main) |
| 12 | +[](https://mvnrepository.com/artifact/io.nats/nkeys-java-jdk21) |
| 13 | +[](https://mvnrepository.com/artifact/io.nats/nkeys-java-jdk25) |
| 14 | +[](http://javadoc.io/doc/io.nats/nkeys-java-jdk21?branch=main) |
| 15 | +[](https://www.apache.org/licenses/LICENSE-2.0) |
15 | 16 |
|
16 | 17 | # Overview |
17 | 18 |
|
@@ -62,7 +63,97 @@ The NATS system will utilize public NKeys for identification, the NATS system |
62 | 63 | will never store or even have access to any private keys or seeds. |
63 | 64 | Authentication will utilize a challenge-response mechanism based on a |
64 | 65 | 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 | +``` |
66 | 157 |
|
67 | 158 | ## License |
68 | 159 |
|
|
0 commit comments