Skip to content

Commit 2d28abe

Browse files
authored
feature(bom): introduce BOM and update to Bolt Connection 4.0.0 (#1653)
This update introduces a Bill of Materials (BOM) for Neo4j Java Driver with the following Maven coordinates: ``` <groupId>org.neo4j.driver</groupId> <artifactId>neo4j-java-driver-bom</artifactId> ``` In addition, it adds support for loading `BoltConnectionProviderFactory` using `java.util.ServiceLoader` and updates Bolt Connection to `4.0.0`. This support is an internal implementation detail and is NOT a public feature that should be used programmatically. Only official implementations of `BoltConnectionProviderFactory` are supported and the extend of such support is individual to each implementation. The `neo4j-java-driver-all` bundles everything in the same artifact.
1 parent 88fc56e commit 2d28abe

File tree

74 files changed

+1081
-984
lines changed

Some content is hidden

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

74 files changed

+1081
-984
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ testkit-backend/bin/
3131
testkit/CAs/
3232
testkit/CustomCAs/
3333
bolt-connection
34+
.flattened-pom.xml
35+

benchkit-backend/LICENSES.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ Apache Software License, Version 2.0
77
Jackson-annotations
88
Jackson-core
99
jackson-databind
10-
Neo4j Bolt Connection (Netty reference impl)
11-
Neo4j Bolt Connection (Pooled provider impl)
10+
Neo4j Bolt Connection (Bolt Provider reference impl)
11+
Neo4j Bolt Connection (Pooled Source impl)
1212
Neo4j Bolt Connection (Provider SPI)
13-
Neo4j Bolt Connection (Routed provider impl)
13+
Neo4j Bolt Connection (Routed Source impl)
1414
Netty/Buffer
15-
Netty/Codec
15+
Netty/Codec/Base
16+
Netty/Codec/Compression
1617
Netty/Codec/HTTP
1718
Netty/Common
1819
Netty/Handler

benchkit-backend/NOTICE.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ Apache Software License, Version 2.0
2222
Jackson-annotations
2323
Jackson-core
2424
jackson-databind
25-
Neo4j Bolt Connection (Netty reference impl)
26-
Neo4j Bolt Connection (Pooled provider impl)
25+
Neo4j Bolt Connection (Bolt Provider reference impl)
26+
Neo4j Bolt Connection (Pooled Source impl)
2727
Neo4j Bolt Connection (Provider SPI)
28-
Neo4j Bolt Connection (Routed provider impl)
28+
Neo4j Bolt Connection (Routed Source impl)
2929
Netty/Buffer
30-
Netty/Codec
30+
Netty/Codec/Base
31+
Netty/Codec/Compression
3132
Netty/Codec/HTTP
3233
Netty/Common
3334
Netty/Handler

benchkit-backend/src/main/java/neo4j/org/testkit/backend/Runner.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
import io.netty.bootstrap.ServerBootstrap;
2020
import io.netty.channel.ChannelInitializer;
2121
import io.netty.channel.EventLoopGroup;
22-
import io.netty.channel.nio.NioEventLoopGroup;
22+
import io.netty.channel.MultiThreadIoEventLoopGroup;
23+
import io.netty.channel.nio.NioIoHandler;
2324
import io.netty.channel.socket.SocketChannel;
2425
import io.netty.channel.socket.nio.NioServerSocketChannel;
2526
import io.netty.handler.codec.http.HttpObjectAggregator;
@@ -35,7 +36,7 @@ public static void main(String[] args) throws InterruptedException {
3536
var config = Config.load();
3637
var driver = GraphDatabase.driver(config.uri(), config.authToken());
3738

38-
EventLoopGroup group = new NioEventLoopGroup();
39+
EventLoopGroup group = new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory());
3940
var executor = Executors.newCachedThreadPool();
4041
var workloadHandler = new WorkloadHandler(driver, executor);
4142
var readyHandler = new ReadyHandler(driver);

bom/LICENSES.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
This file contains the full license text of the included third party
2+
libraries. For an overview of the licenses see the NOTICE.txt file.
3+
4+
5+

bom/NOTICE.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) "Neo4j"
2+
Neo4j Sweden AB [https://neo4j.com]
3+
4+
This file is part of Neo4j.
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
14+
15+
Full license texts are found in LICENSES.txt.
16+
17+
18+
Third-party licenses
19+
--------------------
20+

bom/pom.xml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
3+
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<parent>
7+
<groupId>org.neo4j.driver</groupId>
8+
<artifactId>neo4j-java-driver-parent</artifactId>
9+
<version>6.0-SNAPSHOT</version>
10+
</parent>
11+
12+
<artifactId>neo4j-java-driver-bom</artifactId>
13+
14+
<packaging>pom</packaging>
15+
<name>Neo4j Java Driver (BOM)</name>
16+
<description>The BOM for the Neo4j Java Driver</description>
17+
<url>https://github.com/neo4j/neo4j-java-driver</url>
18+
19+
<properties>
20+
<maven.deploy.skip>false</maven.deploy.skip>
21+
</properties>
22+
23+
<dependencyManagement>
24+
<dependencies>
25+
<dependency>
26+
<groupId>org.neo4j.driver</groupId>
27+
<artifactId>neo4j-java-driver</artifactId>
28+
<version>${project.version}</version>
29+
</dependency>
30+
<dependency>
31+
<groupId>org.neo4j.driver</groupId>
32+
<artifactId>neo4j-java-driver-all</artifactId>
33+
<version>${project.version}</version>
34+
</dependency>
35+
<dependency>
36+
<groupId>org.neo4j.bolt</groupId>
37+
<artifactId>neo4j-bolt-connection-bom</artifactId>
38+
<version>${neo4j-bolt-connection-bom.version}</version>
39+
<type>pom</type>
40+
<scope>import</scope>
41+
</dependency>
42+
</dependencies>
43+
</dependencyManagement>
44+
45+
<build>
46+
<plugins>
47+
<plugin>
48+
<groupId>org.codehaus.mojo</groupId>
49+
<artifactId>flatten-maven-plugin</artifactId>
50+
<executions>
51+
<execution>
52+
<id>flatten</id>
53+
<goals>
54+
<goal>flatten</goal>
55+
</goals>
56+
<phase>process-resources</phase>
57+
<configuration>
58+
<updatePomFile>true</updatePomFile>
59+
<flattenMode>bom</flattenMode>
60+
<pomElements>
61+
<properties>remove</properties>
62+
<dependencyManagement>extended_interpolate</dependencyManagement>
63+
</pomElements>
64+
</configuration>
65+
</execution>
66+
<execution>
67+
<id>flatten-clean</id>
68+
<goals>
69+
<goal>clean</goal>
70+
</goals>
71+
<phase>clean</phase>
72+
</execution>
73+
</executions>
74+
</plugin>
75+
</plugins>
76+
</build>
77+
78+
<scm>
79+
<connection>scm:git:git://github.com/neo4j/neo4j-java-driver.git</connection>
80+
<developerConnection>scm:git:[email protected]:neo4j/neo4j-java-driver.git</developerConnection>
81+
<url>https://github.com/neo4j/neo4j-java-driver</url>
82+
</scm>
83+
84+
</project>

bundle/LICENSES.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ libraries. For an overview of the licenses see the NOTICE.txt file.
44

55
------------------------------------------------------------------------------
66
Apache Software License, Version 2.0
7-
Neo4j Bolt Connection (Netty reference impl)
8-
Neo4j Bolt Connection (Pooled provider impl)
7+
Neo4j Bolt Connection (Bolt Provider reference impl)
8+
Neo4j Bolt Connection (Pooled Source impl)
99
Neo4j Bolt Connection (Provider SPI)
10-
Neo4j Bolt Connection (Routed provider impl)
10+
Neo4j Bolt Connection (Routed Source impl)
1111
Netty/Buffer
12-
Netty/Codec
12+
Netty/Codec/Base
1313
Netty/Common
1414
Netty/Handler
1515
Netty/Resolver

bundle/NOTICE.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ Third-party licenses
1919
--------------------
2020

2121
Apache Software License, Version 2.0
22-
Neo4j Bolt Connection (Netty reference impl)
23-
Neo4j Bolt Connection (Pooled provider impl)
22+
Neo4j Bolt Connection (Bolt Provider reference impl)
23+
Neo4j Bolt Connection (Pooled Source impl)
2424
Neo4j Bolt Connection (Provider SPI)
25-
Neo4j Bolt Connection (Routed provider impl)
25+
Neo4j Bolt Connection (Routed Source impl)
2626
Netty/Buffer
27-
Netty/Codec
27+
Netty/Codec/Base
2828
Netty/Common
2929
Netty/Handler
3030
Netty/Resolver

bundle/src/main/jpms/module-info.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,8 @@
3737
requires static org.slf4j;
3838
requires static java.management;
3939
requires static reactor.blockhound;
40+
41+
uses org.neo4j.driver.internal.shaded.bolt.connection.BoltConnectionProviderFactory;
42+
provides org.neo4j.driver.internal.shaded.bolt.connection.BoltConnectionProviderFactory with
43+
org.neo4j.driver.internal.shaded.bolt.connection.netty.NettyBoltConnectionProviderFactory;
4044
}

driver-it/jul-to-slf4j-log4j-it/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
<dependency>
4646
<groupId>org.junit.jupiter</groupId>
4747
<artifactId>junit-jupiter</artifactId>
48+
<scope>test</scope>
4849
</dependency>
4950
</dependencies>
5051

driver-it/jul-to-slf4j-logback-it/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
<dependency>
4141
<groupId>org.junit.jupiter</groupId>
4242
<artifactId>junit-jupiter</artifactId>
43+
<scope>test</scope>
4344
</dependency>
4445
</dependencies>
4546

driver-it/log4j-it/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
<dependency>
4141
<groupId>org.junit.jupiter</groupId>
4242
<artifactId>junit-jupiter</artifactId>
43+
<scope>test</scope>
4344
</dependency>
4445
</dependencies>
4546

driver-it/slf4j-log4j-it/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
<dependency>
4646
<groupId>org.junit.jupiter</groupId>
4747
<artifactId>junit-jupiter</artifactId>
48+
<scope>test</scope>
4849
</dependency>
4950
</dependencies>
5051

driver-it/slf4j-logback-it/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
<dependency>
4141
<groupId>org.junit.jupiter</groupId>
4242
<artifactId>junit-jupiter</artifactId>
43+
<scope>test</scope>
4344
</dependency>
4445
</dependencies>
4546

driver/LICENSES.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ libraries. For an overview of the licenses see the NOTICE.txt file.
44

55
------------------------------------------------------------------------------
66
Apache Software License, Version 2.0
7-
Neo4j Bolt Connection (Netty reference impl)
8-
Neo4j Bolt Connection (Pooled provider impl)
7+
Neo4j Bolt Connection (Bolt Provider reference impl)
8+
Neo4j Bolt Connection (Pooled Source impl)
99
Neo4j Bolt Connection (Provider SPI)
10-
Neo4j Bolt Connection (Routed provider impl)
10+
Neo4j Bolt Connection (Routed Source impl)
1111
Netty/Buffer
12-
Netty/Codec
12+
Netty/Codec/Base
1313
Netty/Common
1414
Netty/Handler
1515
Netty/Resolver

driver/NOTICE.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ Third-party licenses
1919
--------------------
2020

2121
Apache Software License, Version 2.0
22-
Neo4j Bolt Connection (Netty reference impl)
23-
Neo4j Bolt Connection (Pooled provider impl)
22+
Neo4j Bolt Connection (Bolt Provider reference impl)
23+
Neo4j Bolt Connection (Pooled Source impl)
2424
Neo4j Bolt Connection (Provider SPI)
25-
Neo4j Bolt Connection (Routed provider impl)
25+
Neo4j Bolt Connection (Routed Source impl)
2626
Netty/Buffer
27-
Netty/Codec
27+
Netty/Codec/Base
2828
Netty/Common
2929
Netty/Handler
3030
Netty/Resolver

driver/pom.xml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
<rootDir>${project.basedir}/..</rootDir>
2121
<api.classes.directory>${basedir}/target/classes-without-jpms</api.classes.directory>
2222
<maven.compiler.xlint.extras>,-try</maven.compiler.xlint.extras>
23-
<failsafe.parallelizable.jpms.args>--add-opens org.neo4j.driver/org.neo4j.driver.internal.util=ALL-UNNAMED --add-opens org.neo4j.driver/org.neo4j.driver.internal.async=ALL-UNNAMED</failsafe.parallelizable.jpms.args>
23+
<surefire.jpms.args>--add-reads org.neo4j.driver=io.netty.common --add-reads org.neo4j.driver=org.bouncycastle.provider --add-reads org.neo4j.driver=org.bouncycastle.pkix</surefire.jpms.args>
24+
<failsafe.parallelizable.jpms.args>--add-opens org.neo4j.driver/org.neo4j.driver.internal.util=ALL-UNNAMED --add-opens org.neo4j.driver/org.neo4j.driver.internal.async=ALL-UNNAMED --add-reads org.neo4j.driver=io.netty.common --add-reads org.neo4j.driver=org.bouncycastle.provider --add-reads org.neo4j.driver=org.bouncycastle.pkix</failsafe.parallelizable.jpms.args>
25+
<failsafe.sequential.jpms.args>--add-reads org.neo4j.driver=org.bouncycastle.provider --add-reads org.neo4j.driver=org.bouncycastle.pkix</failsafe.sequential.jpms.args>
2426
<blockhound.tag>blockHoundTest</blockhound.tag>
2527
<maven.deploy.skip>false</maven.deploy.skip>
2628
</properties>
@@ -85,6 +87,7 @@
8587
<dependency>
8688
<groupId>org.junit.jupiter</groupId>
8789
<artifactId>junit-jupiter</artifactId>
90+
<scope>test</scope>
8891
</dependency>
8992
<dependency>
9093
<groupId>org.rauschig</groupId>
@@ -127,6 +130,18 @@
127130
</dependency>
128131
</dependencies>
129132

133+
<dependencyManagement>
134+
<dependencies>
135+
<dependency>
136+
<groupId>org.neo4j.driver</groupId>
137+
<artifactId>neo4j-java-driver-bom</artifactId>
138+
<version>${project.version}</version>
139+
<type>pom</type>
140+
<scope>import</scope>
141+
</dependency>
142+
</dependencies>
143+
</dependencyManagement>
144+
130145
<build>
131146
<pluginManagement>
132147
<plugins>
@@ -264,6 +279,28 @@
264279
<groupId>org.apache.maven.surefire</groupId>
265280
<artifactId>surefire-junit-platform</artifactId>
266281
<version>${surefire.and.failsafe.version}</version>
282+
<exclusions>
283+
<exclusion>
284+
<groupId>org.junit.platform</groupId>
285+
<artifactId>junit-platform-engine</artifactId>
286+
</exclusion>
287+
<exclusion>
288+
<groupId>org.junit.platform</groupId>
289+
<artifactId>junit-platform-launcher</artifactId>
290+
</exclusion>
291+
<exclusion>
292+
<groupId>org.junit.jupiter</groupId>
293+
<artifactId>junit-jupiter-engine</artifactId>
294+
</exclusion>
295+
<exclusion>
296+
<groupId>org.junit.jupiter</groupId>
297+
<artifactId>junit-jupiter-api</artifactId>
298+
</exclusion>
299+
<exclusion>
300+
<groupId>org.junit.jupiter</groupId>
301+
<artifactId>junit-jupiter-params</artifactId>
302+
</exclusion>
303+
</exclusions>
267304
</dependency>
268305
<dependency>
269306
<groupId>org.apache.maven.surefire</groupId>

driver/src/main/java/module-info.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@
3232
exports org.neo4j.driver.mapping;
3333

3434
requires org.neo4j.bolt.connection;
35-
requires org.neo4j.bolt.connection.netty;
3635
requires org.neo4j.bolt.connection.pooled;
3736
requires org.neo4j.bolt.connection.routed;
3837
requires reactor.core;
39-
requires io.netty.common;
4038
requires transitive java.logging;
4139
requires transitive org.reactivestreams;
4240
requires static micrometer.core;
4341
requires static org.graalvm.nativeimage;
4442
requires static org.slf4j;
4543
requires static java.management;
4644
requires static reactor.blockhound;
45+
46+
uses org.neo4j.bolt.connection.BoltConnectionProviderFactory;
4747
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import static java.lang.String.format;
2020
import static org.neo4j.driver.internal.util.DriverInfoUtil.driverVersion;
2121

22-
import io.netty.channel.EventLoop;
2322
import java.io.File;
2423
import java.io.Serial;
2524
import java.io.Serializable;
@@ -359,7 +358,7 @@ public Set<NotificationClassification> disabledNotificationClassifications() {
359358
}
360359

361360
/**
362-
* Returns the number of {@link EventLoop} threads.
361+
* Returns the number of EventLoop threads.
363362
*
364363
* @return the number of threads
365364
*/

0 commit comments

Comments
 (0)