Skip to content

Commit

Permalink
Migrated to Java21
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Nov 20, 2024
1 parent 7d26e68 commit 861fe76
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11'
java-version: '21'
cache: 'maven'

- name: Build with Maven
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 11
java-version: 21
distribution: 'adopt'
cache: 'maven'
server-id: openconext-releases
server-username: MAVEN_USERNAME
Expand Down
2 changes: 1 addition & 1 deletion .java-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11
21
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,19 @@
![coverage](.github/badges/jacoco.svg)
![branches coverage](.github/badges/branches.svg)

# Usage
### [System Requirements](#system-requirements)

- Java 21
- Maven 3

First install Java 21 with a package manager
and then export the correct the `JAVA_HOME`. For example on macOS:

```bash
export JAVA_HOME=/Library/Java/JavaVirtualMachines/openjdk-21.jdk/Contents/Home/
```

### Usage
Create private / public keypair (always use 2048 bit modulus)
```
openssl genrsa -traditional -out private_key.pem 2048
Expand All @@ -12,4 +24,5 @@ openssl rsa -pubout -in private_key.pem -out public_key.pem
Convert private key to pkcs8 format in order to import it from Java
```
openssl pkcs8 -topk8 -in private_key.pem -inform pem -out private_key_pkcs8.pem -outform pem -nocrypt
```
```

18 changes: 9 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

<groupId>org.openconext</groupId>
<artifactId>java-crypto</artifactId>
<version>1.0.5</version>
<version>2.0.0</version>
<packaging>jar</packaging>

<name>java-crypto</name>
<description>java-crypto</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>11</java.version>
<java.version>21</java.version>
</properties>

<dependencies>
Expand All @@ -26,20 +26,20 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.34</version>
<version>1.18.36</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.16.1</version>
<version>2.17.0</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.10.3</version>
<version>5.11.3</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -49,16 +49,16 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.13.0</version>
<configuration>
<release>11</release>
<release>21</release>
</configuration>
</plugin>
<!-- Enforce the correct surefire plugin used by CI -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.0</version>
<version>3.5.2</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
Expand Down Expand Up @@ -95,7 +95,7 @@
<version>3.8.4</version>
</requireMavenVersion>
<requireJavaVersion>
<version>11</version>
<version>21</version>
</requireJavaVersion>
</rules>
</configuration>
Expand Down

0 comments on commit 861fe76

Please sign in to comment.