Skip to content

Commit a986979

Browse files
committed
allow more jdks to be used
1 parent 2e8e80a commit a986979

6 files changed

Lines changed: 111 additions & 50 deletions

File tree

.github/workflows/ci-java.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
java: [ 8, 11, 17, 21 ]
16+
java: [ 8, 11, 17, 21, 25 ]
1717
name: Java ${{ matrix.java }} build
1818
steps:
1919
- uses: actions/checkout@v4

cloudfoundry-client-reactor/pom.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838
<artifactId>logback-classic</artifactId>
3939
<scope>test</scope>
4040
</dependency>
41+
<dependency>
42+
<groupId>com.fasterxml.jackson.core</groupId>
43+
<artifactId>jackson-annotations</artifactId>
44+
<scope>provided</scope>
45+
</dependency>
4146
<dependency>
4247
<groupId>com.fasterxml.jackson.core</groupId>
4348
<artifactId>jackson-databind</artifactId>
@@ -190,5 +195,20 @@
190195
</plugin>
191196
</plugins>
192197
</build>
198+
<profiles>
199+
<profile>
200+
<id>jdk-16+</id>
201+
<activation>
202+
<jdk>(16,]</jdk>
203+
</activation>
204+
<dependencies>
205+
<dependency>
206+
<groupId>org.mockito</groupId>
207+
<artifactId>mockito-subclass</artifactId>
208+
<scope>test</scope>
209+
</dependency>
210+
</dependencies>
211+
</profile>
212+
</profiles>
193213

194214
</project>

cloudfoundry-operations/pom.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
<dependency>
4242
<groupId>com.fasterxml.jackson.core</groupId>
4343
<artifactId>jackson-databind</artifactId>
44+
<scope>provided</scope>
4445
</dependency>
4546
<dependency>
4647
<groupId>io.projectreactor</groupId>
@@ -150,5 +151,20 @@
150151
</plugin>
151152
</plugins>
152153
</build>
154+
<profiles>
155+
<profile>
156+
<id>jdk-16+</id>
157+
<activation>
158+
<jdk>(16,]</jdk>
159+
</activation>
160+
<dependencies>
161+
<dependency>
162+
<groupId>org.mockito</groupId>
163+
<artifactId>mockito-subclass</artifactId>
164+
<scope>test</scope>
165+
</dependency>
166+
</dependencies>
167+
</profile>
168+
</profiles>
153169

154170
</project>

cloudfoundry-util/pom.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,20 @@
128128
</plugin>
129129
</plugins>
130130
</build>
131+
<profiles>
132+
<profile>
133+
<id>jdk-16+</id>
134+
<activation>
135+
<jdk>(16,]</jdk>
136+
</activation>
137+
<dependencies>
138+
<dependency>
139+
<groupId>org.mockito</groupId>
140+
<artifactId>mockito-subclass</artifactId>
141+
<scope>test</scope>
142+
</dependency>
143+
</dependencies>
144+
</profile>
145+
</profiles>
131146

132147
</project>

cloudfoundry-util/src/main/java/org/cloudfoundry/util/ByteArrayPool.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@
2929
import java.util.function.Consumer;
3030

3131
/**
32-
* Dynamically creates {@link byte} arrays and caches them, reusing them once they have been released.
33-
* <p>
34-
* The maximum number of byte arrays is unbounded
35-
* <p>
36-
* The default time-to-live for unused byte arrays is one minute
32+
* Dynamically creates {@link Byte} arrays and caches them, reusing them once they have been
33+
* released.
34+
*
35+
* <p>The maximum number of byte arrays is unbounded
36+
*
37+
* <p>The default time-to-live for unused byte arrays is one minute
3738
*/
3839
public final class ByteArrayPool {
3940

@@ -69,7 +70,7 @@ private ByteArrayPool(int capacity, Duration ttl) {
6970
/**
7071
* Executes a {@link Consumer} providing a pooled {@code byte} array
7172
*
72-
* @param consumer the {@link Consumer} of the {@link byte} array
73+
* @param consumer the {@link Consumer} of the {@link Byte} array
7374
*/
7475
public static void withByteArray(Consumer<byte[]> consumer) {
7576
INSTANCE.doWithByteArray(consumer);

pom.xml

Lines changed: 52 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
</modules>
5656

5757
<properties>
58-
<java.version>1.8</java.version>
5958
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
6059

6160
<dependencies.version>2.7.17</dependencies.version>
@@ -85,7 +84,21 @@
8584
<type>pom</type>
8685
<scope>import</scope>
8786
</dependency>
88-
87+
<dependency>
88+
<groupId>com.fasterxml.jackson.core</groupId>
89+
<artifactId>jackson-core</artifactId>
90+
<version>${jackson.version}</version>
91+
</dependency>
92+
<dependency>
93+
<groupId>com.fasterxml.jackson.core</groupId>
94+
<artifactId>jackson-annotations</artifactId>
95+
<version>${jackson.version}</version>
96+
</dependency>
97+
<dependency>
98+
<groupId>com.fasterxml.jackson.core</groupId>
99+
<artifactId>jackson-databind</artifactId>
100+
<version>${jackson.version}</version>
101+
</dependency>
89102
<dependency>
90103
<groupId>com.github.zafarkhaja</groupId>
91104
<artifactId>java-semver</artifactId>
@@ -163,9 +176,27 @@
163176
<arg>-Xlint:-processing</arg>
164177
<arg>-Xlint:-serial</arg>
165178
</compilerArgs>
179+
<annotationProcessorPaths>
180+
<dependency>
181+
<groupId>org.immutables</groupId>
182+
<artifactId>value</artifactId>
183+
</dependency>
184+
<dependency>
185+
<groupId>com.fasterxml.jackson.core</groupId>
186+
<artifactId>jackson-core</artifactId>
187+
</dependency>
188+
<dependency>
189+
<groupId>com.fasterxml.jackson.core</groupId>
190+
<artifactId>jackson-annotations</artifactId>
191+
</dependency>
192+
<dependency>
193+
<groupId>com.fasterxml.jackson.core</groupId>
194+
<artifactId>jackson-databind</artifactId>
195+
</dependency>
196+
</annotationProcessorPaths>
166197
<showWarnings>true</showWarnings>
167-
<source>${java.version}</source>
168-
<target>${java.version}</target>
198+
<source>${java.specification.version}</source>
199+
<target>${java.specification.version}</target>
169200
</configuration>
170201
</plugin>
171202
<plugin>
@@ -336,52 +367,30 @@
336367
</profile>
337368

338369
<profile>
339-
<id>jdk-17</id>
340-
<activation>
341-
<jdk>17</jdk>
342-
</activation>
343-
<properties>
344-
<java.version>17</java.version>
345-
<dependencies.version>3.2.1</dependencies.version>
346-
<wire.version>4.9.1</wire.version>
347-
<wire.plugin.version>3.0.2</wire.plugin.version>
348-
<wire.suffix>-jvm</wire.suffix>
349-
</properties>
350-
<build>
351-
<finalName>${project.artifactId}-jdk17-${project.version}</finalName>
352-
<plugins>
353-
<plugin>
354-
<groupId>org.apache.maven.plugins</groupId>
355-
<artifactId>maven-compiler-plugin</artifactId>
356-
<!-- @see https://github.com/immutables/immutables/issues/1339#issuecomment-1016125673 -->
357-
<configuration>
358-
<fork>true</fork>
359-
<compilerArgs combine.children="append">
360-
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
361-
</compilerArgs>
362-
<showWarnings>true</showWarnings>
363-
<source>${java.version}</source>
364-
<target>${java.version}</target>
365-
</configuration>
366-
</plugin>
367-
</plugins>
368-
</build>
369-
</profile>
370-
371-
<profile>
372-
<id>jdk-21</id>
370+
<id>jdk-16+</id>
373371
<activation>
374-
<jdk>21</jdk>
372+
<jdk>(16,]</jdk>
375373
</activation>
376374
<properties>
377-
<java.version>21</java.version>
378375
<dependencies.version>3.2.1</dependencies.version>
379376
<wire.version>4.9.1</wire.version>
380377
<wire.plugin.version>3.0.2</wire.plugin.version>
381378
<wire.suffix>-jvm</wire.suffix>
382379
</properties>
380+
<dependencies>
381+
<dependency>
382+
<groupId>org.mockito</groupId>
383+
<artifactId>mockito-core</artifactId>
384+
<version>${mockito.version}</version>
385+
</dependency>
386+
<dependency>
387+
<groupId>org.mockito</groupId>
388+
<artifactId>mockito-subclass</artifactId>
389+
<version>${mockito.version}</version>
390+
</dependency>
391+
</dependencies>
383392
<build>
384-
<finalName>${project.artifactId}-jdk21-${project.version}</finalName>
393+
<finalName>${project.artifactId}-jdk${java.specification.version}-${project.version}</finalName>
385394
<plugins>
386395
<plugin>
387396
<groupId>org.apache.maven.plugins</groupId>
@@ -393,8 +402,8 @@
393402
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
394403
</compilerArgs>
395404
<showWarnings>true</showWarnings>
396-
<source>${java.version}</source>
397-
<target>${java.version}</target>
405+
<source>${java.specification.version}</source>
406+
<target>${java.specification.version}</target>
398407
</configuration>
399408
</plugin>
400409
</plugins>

0 commit comments

Comments
 (0)