Skip to content

Commit 1791555

Browse files
authored
Update to Java 17 (#1264)
* Update to Java 17 * Enable TLSv1.1 for Testkit testing
1 parent e0483f0 commit 1791555

File tree

14 files changed

+27
-42
lines changed

14 files changed

+27
-42
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Network communication is handled using [Bolt Protocol](https://7687.org/).
1010

1111
| Driver Series | Supported Java Runtime versions | Status | Changelog |
1212
| --- | --- | --- | --- |
13-
| 5.0 | 8, 11 | Primary development branch. | [link](https://github.com/neo4j/neo4j-java-driver/wiki/5.0-changelog) |
13+
| 5.0 | 17 | Primary development branch. | [link](https://github.com/neo4j/neo4j-java-driver/wiki/5.0-changelog) |
1414
| 4.4 | 8, 11 | Maintenance. | [link](https://github.com/neo4j/neo4j-java-driver/wiki/4.4-changelog) |
1515
| 4.3 | 8, 11 | Maintenance. | [link](https://github.com/neo4j/neo4j-java-driver/wiki/4.3-changelog) |
1616
| 4.2 | 8, 11 | Maintenance. | [link](https://github.com/neo4j/neo4j-java-driver/wiki/4.2-changelog) |

build/javadoc/overview.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<p>These pages document the official <a href="https://neo4j.com" target="_top">Neo4j</a> driver for Java.</p>
99

10-
<h3>Example</h3>
10+
<h1>Example</h1>
1111

1212
<pre><code>import org.neo4j.driver.*;
1313

driver/src/main/java/org/neo4j/driver/Config.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,6 @@ private ConfigBuilder withMetricsEnabled(boolean enabled) {
605605
* <p>
606606
* {@link MetricsAdapter#MICROMETER} enables implementation based on <a href="https://micrometer.io">Micrometer</a>. The metrics can be obtained
607607
* afterwards via Micrometer means and {@link Driver#metrics()}. Micrometer must be on classpath when using this option.
608-
* <p>
609608
*
610609
* @param metricsAdapter the metrics adapter to use. Use {@link MetricsAdapter#DEV_NULL} to disable metrics.
611610
* @return this builder.

driver/src/main/java/org/neo4j/driver/ConnectionPoolMetrics.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public interface ConnectionPoolMetrics {
105105
* This number increases every time when a connection is acquired.
106106
* See {@link ConnectionPoolMetrics#acquired()} for the total amount of connection acquired since the driver is created.
107107
* The average acquisition time can be calculated using the code below:
108-
* <h2>Example</h2>
108+
* <h4>Example</h4>
109109
* <pre>
110110
* {@code
111111
* ConnectionPoolMetrics previous, current;
@@ -129,7 +129,7 @@ public interface ConnectionPoolMetrics {
129129
* This number increases every time when a connection is established.
130130
* See {@link ConnectionPoolMetrics#created()} for the total amount of connections established since the pool is created.
131131
* The average connection time can be calculated using the code below:
132-
* <h2>Example</h2>
132+
* <h4>Example</h4>
133133
* <pre>
134134
* {@code
135135
* ConnectionPoolMetrics previous, current;
@@ -154,7 +154,7 @@ public interface ConnectionPoolMetrics {
154154
* This number increases every time when a connection is returned back to the pool.
155155
* See {@link ConnectionPoolMetrics#totalInUseCount()} for the total amount of connections that are borrowed out of the pool.
156156
* The average in-use time can be calculated using the code below:
157-
* <h2>Example</h2>
157+
* <h4>Example</h4>
158158
* <pre>
159159
* {@code
160160
* ConnectionPoolMetrics previous, current;

driver/src/main/java/org/neo4j/driver/Session.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ default void executeWriteWithoutResult(Consumer<TransactionContext> contextConsu
261261
* must be values that can be converted to Neo4j types. See {@link Values#parameters(Object...)} for
262262
* a list of allowed types.
263263
*
264-
* <h2>Example</h2>
264+
* <h4>Example</h4>
265265
* <pre>
266266
* {@code
267267
* Map<String, Object> metadata = new HashMap<>();
@@ -289,7 +289,7 @@ default void executeWriteWithoutResult(Consumer<TransactionContext> contextConsu
289289
/**
290290
* Run a query in a managed auto-commit transaction with the specified
291291
* {@link TransactionConfig configuration}, and return a result stream.
292-
* <h2>Example</h2>
292+
* <h4>Example</h4>
293293
* <pre>
294294
* {@code
295295
* Map<String, Object> metadata = new HashMap<>();

driver/src/main/java/org/neo4j/driver/SimpleQueryRunner.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public interface SimpleQueryRunner {
6565
* <p>
6666
* If you are creating parameters programmatically, {@link #run(String, Map)} might be more helpful, it converts your map to a {@link Value} for you.
6767
*
68-
* <h2>Example</h2>
68+
* <h4>Example</h4>
6969
* <pre class="doctest:QueryRunnerDocIT#parameterTest">
7070
* {@code
7171
*
@@ -89,7 +89,7 @@ public interface SimpleQueryRunner {
8989
* This version of run takes a {@link Map} of parameters. The values in the map must be values that can be converted to Neo4j types. See {@link
9090
* Values#parameters(Object...)} for a list of allowed types.
9191
*
92-
* <h2>Example</h2>
92+
* <h4>Example</h4>
9393
* <pre class="doctest:QueryRunnerDocIT#parameterTest">
9494
* {@code
9595
*
@@ -131,7 +131,7 @@ public interface SimpleQueryRunner {
131131

132132
/**
133133
* Run a query and return a result stream.
134-
* <h2>Example</h2>
134+
* <h4>Example</h4>
135135
* <pre class="doctest:QueryRunnerDocIT#queryObjectTest">
136136
* {@code
137137
*

driver/src/main/java/org/neo4j/driver/async/AsyncQueryRunner.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public interface AsyncQueryRunner {
9595
* <p>
9696
* If you are creating parameters programmatically, {@link #runAsync(String, Map)}
9797
* might be more helpful, it converts your map to a {@link Value} for you.
98-
* <h2>Example</h2>
98+
* <h4>Example</h4>
9999
* <pre>
100100
* {@code
101101
*
@@ -126,7 +126,7 @@ public interface AsyncQueryRunner {
126126
* This version of runAsync takes a {@link Map} of parameters. The values in the map
127127
* must be values that can be converted to Neo4j types. See {@link Values#parameters(Object...)} for
128128
* a list of allowed types.
129-
* <h2>Example</h2>
129+
* <h4>Example</h4>
130130
* <pre>
131131
* {@code
132132
*
@@ -186,7 +186,7 @@ public interface AsyncQueryRunner {
186186
/**
187187
* Run a query asynchronously and return a {@link CompletionStage} with a
188188
* result cursor.
189-
* <h2>Example</h2>
189+
* <h4>Example</h4>
190190
* <pre>
191191
* {@code
192192
* Query query = new Query( "MATCH (n) WHERE n.name = $myNameParam RETURN n.age" );

driver/src/main/java/org/neo4j/driver/async/AsyncSession.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ <T> CompletionStage<T> executeWriteAsync(
323323
* This version of runAsync takes a {@link Map} of parameters. The values in the map
324324
* must be values that can be converted to Neo4j types. See {@link Values#parameters(Object...)} for
325325
* a list of allowed types.
326-
* <h2>Example</h2>
326+
* <h4>Example</h4>
327327
* <pre>
328328
* {@code
329329
* Map<String, Object> metadata = new HashMap<>();
@@ -357,7 +357,7 @@ <T> CompletionStage<T> executeWriteAsync(
357357
/**
358358
* Run a query asynchronously in an auto-commit transaction with the specified {@link TransactionConfig configuration} and return a
359359
* {@link CompletionStage} with a result cursor.
360-
* <h2>Example</h2>
360+
* <h4>Example</h4>
361361
* <pre>
362362
* {@code
363363
* Map<String, Object> metadata = new HashMap<>();

driver/src/main/java/org/neo4j/driver/reactive/ReactiveSession.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ default Publisher<ReactiveResult> run(String query, TransactionConfig config) {
168168
* This version of run takes a {@link Map} of parameters. The values in the map must be values that can be converted to Neo4j types. See {@link
169169
* Values#parameters(Object...)} for a list of allowed types.
170170
*
171-
* <h2>Example</h2>
171+
* <h4>Example</h4>
172172
* <pre>
173173
* {@code
174174
* Map<String, Object> metadata = new HashMap<>();
@@ -201,7 +201,7 @@ default Publisher<ReactiveResult> run(String query, Map<String, Object> paramete
201201
* Invoking this method will result in a Bolt RUN message exchange with server and the returned publisher will either emit an instance of {@link
202202
* ReactiveResult} on success or an error otherwise.
203203
*
204-
* <h2>Example</h2>
204+
* <h4>Example</h4>
205205
* <pre>
206206
* {@code
207207
* Map<String, Object> metadata = new HashMap<>();

driver/src/main/java/org/neo4j/driver/reactive/RxSession.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ default Publisher<RxTransaction> beginTransaction() {
170170
* The values in the map must be values that can be converted to Neo4j types.
171171
* See {@link Values#parameters(Object...)} for a list of allowed types.
172172
*
173-
* <h2>Example</h2>
173+
* <h4>Example</h4>
174174
* <pre>
175175
* {@code
176176
* Map<String, Object> metadata = new HashMap<>();
@@ -199,7 +199,7 @@ default Publisher<RxTransaction> beginTransaction() {
199199
* Run a query in an auto-commit transaction with specified {@link TransactionConfig configuration} and return a reactive result stream.
200200
* The query is not executed when the reactive result is returned.
201201
* Instead, the publishers in the result will actually start the execution of the query.
202-
* <h2>Example</h2>
202+
* <h4>Example</h4>
203203
* <pre>
204204
* {@code
205205
* Map<String, Object> metadata = new HashMap<>();

pom.xml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<properties>
1616
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1717
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
18-
<maven.compiler.source>1.8</maven.compiler.source>
19-
<maven.compiler.target>1.8</maven.compiler.target>
18+
<maven.compiler.source>17</maven.compiler.source>
19+
<maven.compiler.target>17</maven.compiler.target>
2020
<maven.build.timestamp.format>'v'yyyyMMdd-HHmm</maven.build.timestamp.format>
2121

2222
<bundle.name>${project.groupId}.${project.artifactId}</bundle.name>
@@ -247,18 +247,6 @@
247247
</build>
248248
</profile>
249249

250-
<profile>
251-
<id>java9</id>
252-
<activation>
253-
<activeByDefault>false</activeByDefault>
254-
<jdk>9</jdk>
255-
</activation>
256-
<properties>
257-
<maven.compiler.source>9</maven.compiler.source>
258-
<maven.compiler.target>9</maven.compiler.target>
259-
</properties>
260-
</profile>
261-
262250
<!-- Disable parallel execution of integration tests with "-DsequentialITs" -->
263251
<profile>
264252
<id>sequentialIntegrationTests</id>
@@ -367,12 +355,12 @@
367355
<plugin>
368356
<groupId>org.apache.maven.plugins</groupId>
369357
<artifactId>maven-shade-plugin</artifactId>
370-
<version>3.2.0</version>
358+
<version>3.3.0</version>
371359
</plugin>
372360
<plugin>
373361
<groupId>com.diffplug.spotless</groupId>
374362
<artifactId>spotless-maven-plugin</artifactId>
375-
<version>2.21.0</version>
363+
<version>2.23.0</version>
376364
<executions>
377365
<execution>
378366
<goals>

testkit-backend/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
<plugin>
6161
<groupId>org.apache.maven.plugins</groupId>
6262
<artifactId>maven-shade-plugin</artifactId>
63-
<version>3.2.4</version>
6463
<executions>
6564
<execution>
6665
<phase>package</phase>

testkit/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
# Install Maven 3.6, Java 11, Java 8 and Python3
2-
FROM maven:3.6.3-openjdk-8
1+
FROM maven:3.8.6-openjdk-18-slim
32

43
RUN apt-get --quiet --quiet update \
54
&& apt-get --quiet --quiet install -y bash python3 \
65
&& rm -rf /var/lib/apt/lists/*
76

87
ENV PYTHON=python3
9-
ENV JAVA_HOME=/usr/local/openjdk-8
108
ENV PATH=$JAVA_HOME/bin:$PATH
119

1210
# Install our own CAs on the image.
1311
# Assumes Linux Debian based image.
1412
# JAVA_HOME needed by update-ca-certificates hook to update Java with changed system CAs.
1513
COPY CAs/* /usr/local/share/ca-certificates/
1614
COPY CustomCAs/* /usr/local/share/custom-ca-certificates/
17-
RUN update-ca-certificates
15+
RUN echo 'jdk.tls.disabledAlgorithms=jdk.tls.disabledAlgorithms=SSLv3, TLSv1, RC4, DES, MD5withRSA, DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL' > /testkit.java.security \
16+
&& update-ca-certificates

testkit/backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
if __name__ == "__main__":
1212
subprocess.check_call(
13-
["java", "-Djdk.tls.client.protocols=TLSv1.3,TLSv1.2,TLSv1.1", "-jar", "testkit-backend/target/testkit-backend.jar",
13+
["java", "-Djava.security.properties=/testkit.java.security", "-jar", "testkit-backend/target/testkit-backend.jar",
1414
os.getenv('TEST_BACKEND_SERVER', '')],
1515
stdout=sys.stdout, stderr=sys.stderr
1616
)

0 commit comments

Comments
 (0)