diff --git a/.husky/pre-commit b/.husky/pre-commit index b81af765..0f2e8465 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -./mvnw sortpom:sort spotless:apply -DspotlessFiles=src/main/java/.*.java +./gradlew spotlessApply diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar deleted file mode 100644 index cb28b0e3..00000000 Binary files a/.mvn/wrapper/maven-wrapper.jar and /dev/null differ diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties deleted file mode 100644 index 346d645f..00000000 --- a/.mvn/wrapper/maven-wrapper.properties +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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. -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip -wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar diff --git a/.teamcity/builds/Build.kt b/.teamcity/builds/Build.kt index 1e298e5b..30a758e3 100644 --- a/.teamcity/builds/Build.kt +++ b/.teamcity/builds/Build.kt @@ -24,16 +24,16 @@ class Build( parallel { listOf("17", "21").forEach { java -> dependentBuildType( - Maven( + Gradle( "${name}-build-${java}", "build - java ${java}", - "sortpom:verify license:check spotless:check compile", - "-DspotlessFiles=src/main/java/.*.java", - java)) + "spotlessCheck build", + // "-DspotlessFiles=src/main/java/.*.java", + javaVersion = java)) } } dependentBuildType( - Maven( + Gradle( "${name}-test", "test", "verify", diff --git a/.teamcity/builds/Common.kt b/.teamcity/builds/Common.kt index 2017eeb9..8b49dec8 100644 --- a/.teamcity/builds/Common.kt +++ b/.teamcity/builds/Common.kt @@ -4,14 +4,17 @@ import jetbrains.buildServer.configs.kotlin.* import jetbrains.buildServer.configs.kotlin.buildFeatures.PullRequests import jetbrains.buildServer.configs.kotlin.buildFeatures.commitStatusPublisher import jetbrains.buildServer.configs.kotlin.buildFeatures.pullRequests +import jetbrains.buildServer.configs.kotlin.buildSteps.GradleBuildStep import jetbrains.buildServer.configs.kotlin.buildSteps.MavenBuildStep import jetbrains.buildServer.configs.kotlin.buildSteps.ScriptBuildStep +import jetbrains.buildServer.configs.kotlin.buildSteps.gradle import jetbrains.buildServer.configs.kotlin.buildSteps.maven import jetbrains.buildServer.configs.kotlin.buildSteps.script const val GITHUB_OWNER = "neo4j" const val GITHUB_REPOSITORY = "import-spec" const val MAVEN_DEFAULT_ARGS = "--no-transfer-progress --batch-mode --show-version" +const val GRADLE_DEFAULT_ARGS = "--quiet" const val DEFAULT_JAVA_VERSION = "17" const val LTS_JAVA_VERSION = "21" @@ -78,14 +81,36 @@ fun BuildSteps.runMaven( return maven } -fun BuildSteps.setVersion(name: String, version: String): MavenBuildStep { - return this.runMaven { +fun BuildSteps.runGradle( + javaVersion: String = DEFAULT_JAVA_VERSION, + init: GradleBuildStep.() -> Unit +): GradleBuildStep { + val maven = + this.gradle { + dockerImagePlatform = GradleBuildStep.ImagePlatform.Linux + dockerImage = "eclipse-temurin:${javaVersion}-jdk" + dockerRunParameters = "--volume /var/run/docker.sock:/var/run/docker.sock" + } + + init(maven) + return maven +} + +fun BuildSteps.setVersion(name: String, version: String): GradleBuildStep { + return this.runGradle { this.name = name - goals = "versions:set" - runnerArgs = "$MAVEN_DEFAULT_ARGS -DnewVersion=$version -DgenerateBackupPoms=false" + gradleParams = "$GRADLE_DEFAULT_ARGS -Pversion=$version" } } +// fun BuildSteps.setVersion(name: String, version: String): MavenBuildStep { +// return this.runMaven { +// this.name = name +// goals = "versions:set" +// runnerArgs = "$MAVEN_DEFAULT_ARGS -DnewVersion=$version -DgenerateBackupPoms=false" +// } +// } + fun BuildSteps.commitAndPush( name: String, commitMessage: String, diff --git a/.teamcity/builds/Gradle.kt b/.teamcity/builds/Gradle.kt new file mode 100644 index 00000000..6c517a50 --- /dev/null +++ b/.teamcity/builds/Gradle.kt @@ -0,0 +1,29 @@ +package builds + +import jetbrains.buildServer.configs.kotlin.BuildType +import jetbrains.buildServer.configs.kotlin.buildFeatures.dockerSupport +import jetbrains.buildServer.configs.kotlin.toId + +class Gradle( + id: String, + name: String, + goals: String, + args: String? = null, + javaVersion: String = DEFAULT_JAVA_VERSION, + size: LinuxSize = LinuxSize.SMALL +) : + BuildType({ + this.id(id.toId()) + this.name = name + + steps { + runGradle(javaVersion) { + this.tasks = goals + this.gradleParams = "$GRADLE_DEFAULT_ARGS ${args ?: ""}" + } + } + + features { dockerSupport {} } + + requirements { runOnLinux(size) } + }) diff --git a/README.md b/README.md index a93ec5bf..4cee8f72 100644 --- a/README.md +++ b/README.md @@ -89,5 +89,5 @@ class GettingStarted { ## Prerequisites -- Maven +- Gradle - JDK 21 (21 is used for tests, 11 and 17 for production sources) diff --git a/build-logic/build.gradle.kts b/build-logic/build.gradle.kts new file mode 100644 index 00000000..917d4454 --- /dev/null +++ b/build-logic/build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + `kotlin-dsl` +} + +repositories { + gradlePluginPortal() +} + +dependencies { + implementation("com.diffplug.spotless:spotless-plugin-gradle:7.2.1") +} diff --git a/build-logic/src/main/kotlin/buildlogic.java-conventions.gradle.kts b/build-logic/src/main/kotlin/buildlogic.java-conventions.gradle.kts new file mode 100644 index 00000000..3d2b1c6b --- /dev/null +++ b/build-logic/src/main/kotlin/buildlogic.java-conventions.gradle.kts @@ -0,0 +1,87 @@ +plugins { + `java-library` + `maven-publish` + id("com.diffplug.spotless") +} + +repositories { + mavenLocal() + maven { + url = uri("https://repo.maven.apache.org/maven2/") + } +} + +group = "org.neo4j.importer" +version = "1.0.0-SNAPSHOT" + +java { + withSourcesJar() + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} + +publishing { + publications.create("maven") { + from(components["java"]) + pom { + name.set(project.name) + description.set("Uniform Import Specification Library for Neo4j") + url.set("https://github.com/neo4j/import-spec") + inceptionYear.set("2024") + organization { + name.set("Neo4j, Neo4j Sweden AB") + url.set("https://neo4j.com") + } + licenses { + license { + name.set("Apache License, Version 2.0") + url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") + distribution.set("manual") + } + } + developers { + developer { + id.set("team-connectors") + name.set("Connectors Team") + organization.set("Neo4j") + organizationUrl.set("https://neo4j.com") + } + } + scm { + connection.set("scm:git:git://github.com/neo4j/import-spec.git") + developerConnection.set("scm:git:git@github.com:neo4j/import-spec.git") + url.set("https://github.com/neo4j/import-spec") + } + } + } + + repositories { + maven { + name = project.findProperty("repositoryId") as? String ?: "default" + url = uri(project.findProperty("repositoryUrl") ?: "${layout.buildDirectory}/repo") + } + } +} + +tasks.withType { + options.encoding = "UTF-8" +} + +tasks.withType { + options.encoding = "UTF-8" +} + +configure { + java { + target("src/main/java/**/*.java", "src/test/java/**/*.java") + palantirJavaFormat("2.74.0") + } + kotlin { + ktfmt().kotlinlangStyle() + licenseHeaderFile(rootProject.file("license-header.txt")) + } + kotlinGradle { + target("*.gradle.kts") + ktfmt().kotlinlangStyle() + } +} diff --git a/core/build.gradle.kts b/core/build.gradle.kts new file mode 100644 index 00000000..4820111a --- /dev/null +++ b/core/build.gradle.kts @@ -0,0 +1,34 @@ +plugins { id("buildlogic.java-conventions") } + +dependencies { + api(libs.com.fasterxml.jackson.dataformat.jackson.dataformat.yaml) + api(libs.com.networknt.json.schema.validator) + testImplementation(libs.org.apache.beam.beam.sdks.java.myextensions.sql) + testImplementation(libs.org.apache.beam.beam.sdks.java.io.jdbc) + testImplementation(libs.org.assertj.assertj.core) + testImplementation(libs.org.junit.jupiter.junit.jupiter) + testImplementation(libs.org.junit.jupiter.junit.jupiter.params) + testImplementation(libs.org.junit.vintage.junit.vintage.engine) + testImplementation(libs.org.neo4j.driver.neo4j.java.driver) + testImplementation(libs.org.postgresql.postgresql) + testImplementation(libs.org.slf4j.slf4j.nop) + testImplementation(libs.org.testcontainers.junit.jupiter) + testImplementation(libs.org.testcontainers.neo4j) + testImplementation(libs.org.testcontainers.postgresql) + testImplementation(libs.org.testcontainers.testcontainers) +} + +description = "import-spec" + +java { + withJavadocJar() + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} + +tasks { + compileTestJava { + sourceCompatibility = "21" + targetCompatibility = "21" + } +} diff --git a/core/pom.xml b/core/pom.xml deleted file mode 100644 index df0df437..00000000 --- a/core/pom.xml +++ /dev/null @@ -1,137 +0,0 @@ - - - 4.0.0 - - org.neo4j.importer - import-spec-parent - 1.0.0-SNAPSHOT - - import-spec - import-spec - - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - - - com.networknt - json-schema-validator - 1.5.9 - - - org.apache.beam - beam-sdks-java-extensions-sql - test - - - org.apache.beam - beam-sdks-java-io-jdbc - test - - - org.assertj - assertj-core - test - - - org.junit.jupiter - junit-jupiter - test - - - org.junit.jupiter - junit-jupiter-params - test - - - org.junit.vintage - junit-vintage-engine - test - - - org.neo4j.driver - neo4j-java-driver - test - - - org.postgresql - postgresql - 42.7.8 - test - - - org.slf4j - slf4j-nop - test - - - org.testcontainers - junit-jupiter - test - - - org.testcontainers - neo4j - test - - - org.testcontainers - postgresql - test - - - org.testcontainers - testcontainers - test - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - compile-java-17 - - compile - - compile - - 17 - - ${project.basedir}/src/main/java17 - - true - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - - - run-e2e-tests - - integration-test - verify - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - true - - - - - - - diff --git a/examples/apache-beam/build.gradle.kts b/examples/apache-beam/build.gradle.kts new file mode 100644 index 00000000..87f2f016 --- /dev/null +++ b/examples/apache-beam/build.gradle.kts @@ -0,0 +1,27 @@ +plugins { id("buildlogic.java-conventions") } + +dependencies { + testImplementation(project(":import-spec")) + testImplementation(libs.org.apache.beam.beam.sdks.java.myextensions.sql) + testImplementation(libs.org.apache.beam.beam.sdks.java.io.parquet) + testImplementation(libs.org.apache.hadoop.hadoop.client.runtime) + testImplementation(libs.org.apache.hadoop.hadoop.common) + testImplementation(libs.org.apache.hadoop.hadoop.mapreduce.client.core) + testImplementation(libs.org.assertj.assertj.core) + testImplementation(libs.org.junit.jupiter.junit.jupiter) + testImplementation(libs.org.junit.vintage.junit.vintage.engine) + testImplementation(libs.org.neo4j.neo4j.cypher.dsl) + testImplementation(libs.org.neo4j.driver.neo4j.java.driver) + testImplementation(libs.org.slf4j.slf4j.nop) + testImplementation(libs.org.testcontainers.junit.jupiter) + testImplementation(libs.org.testcontainers.neo4j) + testImplementation(libs.org.testcontainers.testcontainers) +} + +description = "apache-beam-example" + +java { + withJavadocJar() + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 +} diff --git a/examples/apache-beam/pom.xml b/examples/apache-beam/pom.xml deleted file mode 100644 index eb8fed65..00000000 --- a/examples/apache-beam/pom.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - 4.0.0 - - org.neo4j.importer - import-spec-examples-parent - 1.0.0-SNAPSHOT - - apache-beam-example - apache-beam-example - - 3.4.2 - - - - ${project.groupId} - import-spec - test - - - org.apache.beam - beam-sdks-java-extensions-sql - test - - - org.apache.beam - beam-sdks-java-io-parquet - test - - - - org.apache.hadoop - hadoop-client-runtime - ${hadoop.version} - test - - - - org.apache.hadoop - hadoop-common - ${hadoop.version} - test - - - - org.apache.hadoop - hadoop-mapreduce-client-core - ${hadoop.version} - test - - - org.assertj - assertj-core - test - - - org.junit.jupiter - junit-jupiter - test - - - org.junit.vintage - junit-vintage-engine - test - - - org.neo4j - neo4j-cypher-dsl - test - - - org.neo4j.driver - neo4j-java-driver - test - - - org.slf4j - slf4j-nop - test - - - org.testcontainers - junit-jupiter - test - - - org.testcontainers - neo4j - test - - - org.testcontainers - testcontainers - test - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - - - run-example - - integration-test - verify - - - - - - - diff --git a/examples/neo4j-admin/build.gradle.kts b/examples/neo4j-admin/build.gradle.kts new file mode 100644 index 00000000..9091f7b1 --- /dev/null +++ b/examples/neo4j-admin/build.gradle.kts @@ -0,0 +1,22 @@ +plugins { id("buildlogic.java-conventions") } + +dependencies { + testImplementation(project(":import-spec")) + testImplementation(libs.org.assertj.assertj.core) + testImplementation(libs.org.duckdb.duckdb.jdbc) + testImplementation(libs.org.junit.jupiter.junit.jupiter) + testImplementation(libs.org.neo4j.neo4j.cypher.dsl) + testImplementation(libs.org.neo4j.driver.neo4j.java.driver) + testImplementation(libs.org.slf4j.slf4j.nop) + testImplementation(libs.org.testcontainers.junit.jupiter) + testImplementation(libs.org.testcontainers.neo4j) + testImplementation(libs.org.testcontainers.testcontainers) +} + +description = "neo4j-admin-example" + +java { + withJavadocJar() + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 +} diff --git a/examples/neo4j-admin/pom.xml b/examples/neo4j-admin/pom.xml deleted file mode 100644 index 660e1385..00000000 --- a/examples/neo4j-admin/pom.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - 4.0.0 - - org.neo4j.importer - import-spec-examples-parent - 1.0.0-SNAPSHOT - - neo4j-admin-example - neo4j-admin-example - - - ${project.groupId} - import-spec - test - - - org.assertj - assertj-core - test - - - org.duckdb - duckdb_jdbc - 1.4.0.0 - test - - - org.junit.jupiter - junit-jupiter - test - - - org.neo4j - neo4j-cypher-dsl - test - - - org.neo4j.driver - neo4j-java-driver - test - - - org.slf4j - slf4j-nop - test - - - org.testcontainers - junit-jupiter - test - - - org.testcontainers - neo4j - test - - - org.testcontainers - testcontainers - test - - - diff --git a/examples/pom.xml b/examples/pom.xml deleted file mode 100644 index ce49448d..00000000 --- a/examples/pom.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - 4.0.0 - - org.neo4j.importer - import-spec-parent - 1.0.0-SNAPSHOT - - import-spec-examples-parent - pom - import-spec-examples-parent - - apache-beam - neo4j-admin - - - - - ${project.groupId} - import-spec - ${project.version} - - - org.neo4j - neo4j-cypher-dsl - 2025.0.2 - - - - - - - maven-deploy-plugin - - true - - - - maven-install-plugin - - true - - - - maven-jar-plugin - - true - - - - - diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 00000000..072d33a6 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,45 @@ +[versions] +com-fasterxml-jackson-dataformat-jackson-dataformat-yaml = "2.20.0" +com-networknt-json-schema-validator = "1.5.8" +org-apache-beam-beam-sdks-java-io-jdbc = "2.67.0" +org-apache-beam-beam-sdks-java-io-parquet = "2.67.0" +org-apache-beam-beam-sdks-java-myextensions-sql = "2.67.0" +org-apache-hadoop-hadoop-client-runtime = "3.4.2" +org-apache-hadoop-hadoop-common = "3.4.2" +org-apache-hadoop-hadoop-mapreduce-client-core = "3.4.2" +org-assertj-assertj-core = "3.27.5" +org-duckdb-duckdb-jdbc = "1.4.0.0" +org-junit-jupiter-junit-jupiter = "5.13.4" +org-junit-jupiter-junit-jupiter-params = "5.13.4" +org-junit-vintage-junit-vintage-engine = "5.13.4" +org-neo4j-driver-neo4j-java-driver = "5.28.9" +org-neo4j-neo4j-cypher-dsl = "2025.0.1" +org-postgresql-postgresql = "42.7.8" +org-slf4j-slf4j-nop = "2.0.17" +org-testcontainers-junit-jupiter = "1.21.3" +org-testcontainers-neo4j = "1.21.3" +org-testcontainers-postgresql = "1.21.3" +org-testcontainers-testcontainers = "1.21.3" + +[libraries] +com-fasterxml-jackson-dataformat-jackson-dataformat-yaml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version.ref = "com-fasterxml-jackson-dataformat-jackson-dataformat-yaml" } +com-networknt-json-schema-validator = { module = "com.networknt:json-schema-validator", version.ref = "com-networknt-json-schema-validator" } +org-apache-beam-beam-sdks-java-io-jdbc = { module = "org.apache.beam:beam-sdks-java-io-jdbc", version.ref = "org-apache-beam-beam-sdks-java-io-jdbc" } +org-apache-beam-beam-sdks-java-io-parquet = { module = "org.apache.beam:beam-sdks-java-io-parquet", version.ref = "org-apache-beam-beam-sdks-java-io-parquet" } +org-apache-beam-beam-sdks-java-myextensions-sql = { module = "org.apache.beam:beam-sdks-java-extensions-sql", version.ref = "org-apache-beam-beam-sdks-java-myextensions-sql" } +org-apache-hadoop-hadoop-client-runtime = { module = "org.apache.hadoop:hadoop-client-runtime", version.ref = "org-apache-hadoop-hadoop-client-runtime" } +org-apache-hadoop-hadoop-common = { module = "org.apache.hadoop:hadoop-common", version.ref = "org-apache-hadoop-hadoop-common" } +org-apache-hadoop-hadoop-mapreduce-client-core = { module = "org.apache.hadoop:hadoop-mapreduce-client-core", version.ref = "org-apache-hadoop-hadoop-mapreduce-client-core" } +org-assertj-assertj-core = { module = "org.assertj:assertj-core", version.ref = "org-assertj-assertj-core" } +org-duckdb-duckdb-jdbc = { module = "org.duckdb:duckdb_jdbc", version.ref = "org-duckdb-duckdb-jdbc" } +org-junit-jupiter-junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "org-junit-jupiter-junit-jupiter" } +org-junit-jupiter-junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "org-junit-jupiter-junit-jupiter-params" } +org-junit-vintage-junit-vintage-engine = { module = "org.junit.vintage:junit-vintage-engine", version.ref = "org-junit-vintage-junit-vintage-engine" } +org-neo4j-driver-neo4j-java-driver = { module = "org.neo4j.driver:neo4j-java-driver", version.ref = "org-neo4j-driver-neo4j-java-driver" } +org-neo4j-neo4j-cypher-dsl = { module = "org.neo4j:neo4j-cypher-dsl", version.ref = "org-neo4j-neo4j-cypher-dsl" } +org-postgresql-postgresql = { module = "org.postgresql:postgresql", version.ref = "org-postgresql-postgresql" } +org-slf4j-slf4j-nop = { module = "org.slf4j:slf4j-nop", version.ref = "org-slf4j-slf4j-nop" } +org-testcontainers-junit-jupiter = { module = "org.testcontainers:junit-jupiter", version.ref = "org-testcontainers-junit-jupiter" } +org-testcontainers-neo4j = { module = "org.testcontainers:neo4j", version.ref = "org-testcontainers-neo4j" } +org-testcontainers-postgresql = { module = "org.testcontainers:postgresql", version.ref = "org-testcontainers-postgresql" } +org-testcontainers-testcontainers = { module = "org.testcontainers:testcontainers", version.ref = "org-testcontainers-testcontainers" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..a4b76b95 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..9355b415 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100755 index 00000000..f5feea6d --- /dev/null +++ b/gradlew @@ -0,0 +1,252 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# 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 +# +# https://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. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 00000000..9d21a218 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,94 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/jreleaser.yml b/jreleaser.yml index dfae0da4..25a1d01f 100644 --- a/jreleaser.yml +++ b/jreleaser.yml @@ -53,7 +53,7 @@ hooks: verbose: true shell: BASH run: | - ./mvnw --quiet --batch-mode clean deploy -DskipTests -DaltDeploymentRepository=default::file://{{basedir}}/target/maven-artifacts + ./gradlew clean publish -x test --quiet -PrepositoryUrl=file://$PWD/target/maven-artifacts -PrepositoryId=default signing: active: ALWAYS diff --git a/license-header.txt b/license-header.txt new file mode 100644 index 00000000..e235f8ca --- /dev/null +++ b/license-header.txt @@ -0,0 +1,5 @@ +/* + * Copyright (c) "Neo4j" + * Neo4j Sweden AB [https://neo4j.com] + * This file is part of Neo4j internal tooling. + */ \ No newline at end of file diff --git a/mvnw b/mvnw deleted file mode 100755 index 8d937f4c..00000000 --- a/mvnw +++ /dev/null @@ -1,308 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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. -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Apache Maven Wrapper startup batch script, version 3.2.0 -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir -# -# Optional ENV vars -# ----------------- -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files -# ---------------------------------------------------------------------------- - -if [ -z "$MAVEN_SKIP_RC" ] ; then - - if [ -f /usr/local/etc/mavenrc ] ; then - . /usr/local/etc/mavenrc - fi - - if [ -f /etc/mavenrc ] ; then - . /etc/mavenrc - fi - - if [ -f "$HOME/.mavenrc" ] ; then - . "$HOME/.mavenrc" - fi - -fi - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false -case "$(uname)" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html - if [ -z "$JAVA_HOME" ]; then - if [ -x "/usr/libexec/java_home" ]; then - JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME - else - JAVA_HOME="/Library/Java/Home"; export JAVA_HOME - fi - fi - ;; -esac - -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=$(java-config --jre-home) - fi -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$JAVA_HOME" ] && - JAVA_HOME=$(cygpath --unix "$JAVA_HOME") - [ -n "$CLASSPATH" ] && - CLASSPATH=$(cygpath --path --unix "$CLASSPATH") -fi - -# For Mingw, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] && - JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); pwd)" -fi - -if [ -z "$JAVA_HOME" ]; then - javaExecutable="$(which javac)" - if [ -n "$javaExecutable" ] && ! [ "$(expr "\"$javaExecutable\"" : '\([^ ]*\)')" = "no" ]; then - # readlink(1) is not available as standard on Solaris 10. - readLink=$(which readlink) - if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then - if $darwin ; then - javaHome="$(dirname "\"$javaExecutable\"")" - javaExecutable="$(cd "\"$javaHome\"" && pwd -P)/javac" - else - javaExecutable="$(readlink -f "\"$javaExecutable\"")" - fi - javaHome="$(dirname "\"$javaExecutable\"")" - javaHome=$(expr "$javaHome" : '\(.*\)/bin') - JAVA_HOME="$javaHome" - export JAVA_HOME - fi - fi -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD="$(\unset -f command 2>/dev/null; \command -v java)" - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." >&2 - echo " We cannot execute $JAVACMD" >&2 - exit 1 -fi - -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." -fi - -# traverses directory structure from process work directory to filesystem root -# first directory with .mvn subdirectory is considered project base directory -find_maven_basedir() { - if [ -z "$1" ] - then - echo "Path not specified to find_maven_basedir" - return 1 - fi - - basedir="$1" - wdir="$1" - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break - fi - # workaround for JBEAP-8937 (on Solaris 10/Sparc) - if [ -d "${wdir}" ]; then - wdir=$(cd "$wdir/.." || exit 1; pwd) - fi - # end of workaround - done - printf '%s' "$(cd "$basedir" || exit 1; pwd)" -} - -# concatenates all lines of a file -concat_lines() { - if [ -f "$1" ]; then - # Remove \r in case we run on Windows within Git Bash - # and check out the repository with auto CRLF management - # enabled. Otherwise, we may read lines that are delimited with - # \r\n and produce $'-Xarg\r' rather than -Xarg due to word - # splitting rules. - tr -s '\r\n' ' ' < "$1" - fi -} - -log() { - if [ "$MVNW_VERBOSE" = true ]; then - printf '%s\n' "$1" - fi -} - -BASE_DIR=$(find_maven_basedir "$(dirname "$0")") -if [ -z "$BASE_DIR" ]; then - exit 1; -fi - -MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR -log "$MAVEN_PROJECTBASEDIR" - -########################################################################################## -# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -# This allows using the maven wrapper in projects that prohibit checking in binary data. -########################################################################################## -wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" -if [ -r "$wrapperJarPath" ]; then - log "Found $wrapperJarPath" -else - log "Couldn't find $wrapperJarPath, downloading it ..." - - if [ -n "$MVNW_REPOURL" ]; then - wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" - else - wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" - fi - while IFS="=" read -r key value; do - # Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' ) - safeValue=$(echo "$value" | tr -d '\r') - case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;; - esac - done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" - log "Downloading from: $wrapperUrl" - - if $cygwin; then - wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath") - fi - - if command -v wget > /dev/null; then - log "Found wget ... using wget" - [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet" - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" - else - wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" - fi - elif command -v curl > /dev/null; then - log "Found curl ... using curl" - [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent" - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" - else - curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" - fi - else - log "Falling back to using Java to download" - javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java" - javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class" - # For Cygwin, switch paths to Windows format before running javac - if $cygwin; then - javaSource=$(cygpath --path --windows "$javaSource") - javaClass=$(cygpath --path --windows "$javaClass") - fi - if [ -e "$javaSource" ]; then - if [ ! -e "$javaClass" ]; then - log " - Compiling MavenWrapperDownloader.java ..." - ("$JAVA_HOME/bin/javac" "$javaSource") - fi - if [ -e "$javaClass" ]; then - log " - Running MavenWrapperDownloader.java ..." - ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath" - fi - fi - fi -fi -########################################################################################## -# End of extension -########################################################################################## - -# If specified, validate the SHA-256 sum of the Maven wrapper jar file -wrapperSha256Sum="" -while IFS="=" read -r key value; do - case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;; - esac -done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" -if [ -n "$wrapperSha256Sum" ]; then - wrapperSha256Result=false - if command -v sha256sum > /dev/null; then - if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then - wrapperSha256Result=true - fi - elif command -v shasum > /dev/null; then - if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then - wrapperSha256Result=true - fi - else - echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." - echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties." - exit 1 - fi - if [ $wrapperSha256Result = false ]; then - echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2 - echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2 - echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2 - exit 1 - fi -fi - -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$JAVA_HOME" ] && - JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME") - [ -n "$CLASSPATH" ] && - CLASSPATH=$(cygpath --path --windows "$CLASSPATH") - [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR") -fi - -# Provide a "standardized" way to retrieve the CLI args that will -# work with both Windows and non-Windows executions. -MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" -export MAVEN_CMD_LINE_ARGS - -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -# shellcheck disable=SC2086 # safe args -exec "$JAVACMD" \ - $MAVEN_OPTS \ - $MAVEN_DEBUG_OPTS \ - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/mvnw.cmd b/mvnw.cmd deleted file mode 100644 index f80fbad3..00000000 --- a/mvnw.cmd +++ /dev/null @@ -1,205 +0,0 @@ -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Apache Maven Wrapper startup batch script, version 3.2.0 -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM set title of command window -title %0 -@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* -if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" - -FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( - IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B -) - -@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -@REM This allows using the maven wrapper in projects that prohibit checking in binary data. -if exist %WRAPPER_JAR% ( - if "%MVNW_VERBOSE%" == "true" ( - echo Found %WRAPPER_JAR% - ) -) else ( - if not "%MVNW_REPOURL%" == "" ( - SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" - ) - if "%MVNW_VERBOSE%" == "true" ( - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %WRAPPER_URL% - ) - - powershell -Command "&{"^ - "$webclient = new-object System.Net.WebClient;"^ - "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ - "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ - "}"^ - "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^ - "}" - if "%MVNW_VERBOSE%" == "true" ( - echo Finished downloading %WRAPPER_JAR% - ) -) -@REM End of extension - -@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file -SET WRAPPER_SHA_256_SUM="" -FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( - IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B -) -IF NOT %WRAPPER_SHA_256_SUM%=="" ( - powershell -Command "&{"^ - "$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^ - "If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^ - " Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^ - " Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^ - " Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^ - " exit 1;"^ - "}"^ - "}" - if ERRORLEVEL 1 goto error -) - -@REM Provide a "standardized" way to retrieve the CLI args that will -@REM work with both Windows and non-Windows executions. -set MAVEN_CMD_LINE_ARGS=%* - -%MAVEN_JAVA_EXE% ^ - %JVM_CONFIG_MAVEN_PROPS% ^ - %MAVEN_OPTS% ^ - %MAVEN_DEBUG_OPTS% ^ - -classpath %WRAPPER_JAR% ^ - "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ - %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" -if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%"=="on" pause - -if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% - -cmd /C exit /B %ERROR_CODE% diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 56208009..00000000 --- a/pom.xml +++ /dev/null @@ -1,270 +0,0 @@ - - - 4.0.0 - org.neo4j.importer - import-spec-parent - 1.0.0-SNAPSHOT - pom - import-spec-parent - Uniform Import Specification Library for Neo4j - https://github.com/neo4j/import-spec - 2024 - - Neo4j, Neo4j Sweden AB - https://neo4j.com - - - - Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt - manual - - - - - team-connectors - Connectors Team - Neo4j - https://neo4j.com - - - - core - examples - - - scm:git:git://github.com/neo4j/import-spec.git - scm:git:git@github.com:neo4j/import-spec.git - https://github.com/neo4j/import-spec - - - 2.68.0 - 1.18.0 - neo4j_apache_v2 - 11 - 21 - UTF-8 - - - - - com.fasterxml.jackson - jackson-bom - 2.20.0 - pom - import - - - org.apache.beam - beam-sdks-java-bom - ${beam.version} - pom - import - - - org.junit - junit-bom - 5.13.4 - pom - import - - - org.testcontainers - testcontainers-bom - 1.21.3 - pom - import - - - org.assertj - assertj-core - 3.27.6 - - - org.neo4j.driver - neo4j-java-driver - 5.28.9 - - - org.slf4j - slf4j-nop - 2.0.17 - - - - - sortpom:sort license:format spotless:apply verify - - - - maven-clean-plugin - 3.5.0 - - - maven-resources-plugin - 3.3.1 - - - maven-compiler-plugin - 3.14.1 - - none - - - - maven-surefire-plugin - 3.5.4 - - - maven-jar-plugin - 3.4.2 - - - maven-install-plugin - 3.1.4 - - - maven-deploy-plugin - 3.1.4 - - - maven-site-plugin - 3.21.0 - - - maven-project-info-reports-plugin - 3.9.0 - - - maven-javadoc-plugin - 3.12.0 - - - maven-source-plugin - 3.3.1 - - - org.apache.maven.plugins - maven-failsafe-plugin - 3.5.4 - - - - - - com.diffplug.spotless - spotless-maven-plugin - 2.46.1 - - - - src/main/java/**/*.java - src/test/java/**/*.java - - - - - - - - check - - compile - - - - - com.github.ekryd.sortpom - sortpom-maven-plugin - 4.0.0 - - ${project.build.sourceEncoding} - false - schemaLocation - 4 - true - scope,groupId,artifactId - false - false - - - - - verify - - validate - - STOP - - - - - - com.mycila - license-maven-plugin - 5.0.0 - - true - - -
/license/${license.id}/header.txt
- - src/**/*.java - -
-
- - SLASHSTAR_STYLE - -
- - - org.neo4j.build - resources - 2024-12.1 - - - - - check-licenses - - check - - compile - - -
- - org.apache.maven.plugins - maven-javadoc-plugin - - - attach-javadocs - - jar - - - true - - - - - - org.apache.maven.plugins - maven-source-plugin - - - attach-sources - - jar - - - true - - - - -
-
-
diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 00000000..8251bbca --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,13 @@ +pluginManagement { + includeBuild("build-logic") +} + +rootProject.name = "import-spec-parent" +include(":apache-beam-example") +include(":import-spec") +include(":neo4j-admin-example") +include(":import-spec-examples-parent") +project(":apache-beam-example").projectDir = file("examples/apache-beam") +project(":import-spec").projectDir = file("core") +project(":neo4j-admin-example").projectDir = file("examples/neo4j-admin") +project(":import-spec-examples-parent").projectDir = file("examples")