diff --git a/README.md b/README.md index 97f2f106d1..1a13833b17 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,9 @@ All available versions of this driver can be found at Both `neo4j-java-driver` and `neo4j-java-driver-all` artifacts have `org.neo4j.driver` module name. -Starting from version 5.0 the `neo4j-java-driver` includes an explicit module declaration ([module-info.java](driver/src/main/java/module-info.java)). The `neo4j-java-driver-all` stays unchanged and is shipped as an automatic module. +Starting from version 5.0 the `neo4j-java-driver` includes an explicit module declaration ([module-info.java](driver/src/main/java/module-info.java)). + +The `neo4j-java-driver-all` includes an explicit module declaration ([module-info.java](bundle/src/main/jpms/module-info.java)) starting from version 5.7. ### Example diff --git a/bundle/pom.xml b/bundle/pom.xml index 8cebacb600..f12f34c5f1 100644 --- a/bundle/pom.xml +++ b/bundle/pom.xml @@ -100,9 +100,6 @@ **\/*.java - - module-info.java - @@ -210,6 +207,12 @@ META-INF/native-image/** + + ${groupId}:${artifactId} + + module-info.java + + true true @@ -217,6 +220,26 @@ + + org.apache.maven.plugins + maven-antrun-plugin + + + add-module-info-to-sources + package + + run + + + + + + + + + + + org.moditect moditect-maven-plugin @@ -230,26 +253,9 @@ true - + + ${basedir}/src/main/jpms/module-info.java + diff --git a/bundle/src/main/jpms/module-info.java b/bundle/src/main/jpms/module-info.java new file mode 100644 index 0000000000..f883518346 --- /dev/null +++ b/bundle/src/main/jpms/module-info.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) "Neo4j" + * Neo4j Sweden AB [http://neo4j.com] + * + * This file is part of Neo4j. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * The Neo4j Java Driver module. + */ +@SuppressWarnings({"requires-automatic", "requires-transitive-automatic"}) +module org.neo4j.driver { + exports org.neo4j.driver; + exports org.neo4j.driver.async; + exports org.neo4j.driver.reactive; + exports org.neo4j.driver.reactivestreams; + exports org.neo4j.driver.types; + exports org.neo4j.driver.summary; + exports org.neo4j.driver.net; + exports org.neo4j.driver.util; + exports org.neo4j.driver.exceptions; + + requires transitive java.logging; + requires transitive org.reactivestreams; + requires static micrometer.core; + requires static org.graalvm.sdk; + requires static org.slf4j; + requires static java.management; +} diff --git a/pom.xml b/pom.xml index 651d1959a8..2565bef14f 100644 --- a/pom.xml +++ b/pom.xml @@ -620,6 +620,11 @@ moditect-maven-plugin 1.0.0.RC2 + + org.apache.maven.plugins + maven-antrun-plugin + 3.1.0 +