diff --git a/.github/workflows/release_java.yml b/.github/workflows/release_java.yml index fcb6bfe8e9b..c9f2e314807 100644 --- a/.github/workflows/release_java.yml +++ b/.github/workflows/release_java.yml @@ -67,6 +67,7 @@ jobs: ./mvnw -Papache-release package verify org.sonatype.plugins:nexus-staging-maven-plugin:deploy \ -DskipTests=true \ -Djni.classifier=${{ matrix.classifier }} \ + -Dcargo-build.release=--release \ -DaltStagingDirectory=local-staging \ -DskipRemoteStaging=true \ -DserverId=apache.releases.https \ diff --git a/bindings/java/pom.xml b/bindings/java/pom.xml index a02c305b1c3..a7c8bfc1342 100644 --- a/bindings/java/pom.xml +++ b/bindings/java/pom.xml @@ -52,9 +52,10 @@ 1.8 1.8 + --no-release ${os.detected.classifier} - 3.23.1 + 3.23.1 1.18.26 2.0.7 1.18.3 @@ -91,7 +92,7 @@ org.assertj assertj-core - ${assertj-version} + ${assertj.version} org.projectlombok @@ -190,6 +191,7 @@ ${project.basedir}/tools/build.py --classifier ${jni.classifier} + ${cargo-build.release} diff --git a/bindings/java/tools/build.py b/bindings/java/tools/build.py index bae9f8b7818..0e706b5ce5f 100755 --- a/bindings/java/tools/build.py +++ b/bindings/java/tools/build.py @@ -17,7 +17,7 @@ # under the License. -from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser +from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser, BooleanOptionalAction from pathlib import Path import shutil import subprocess @@ -52,9 +52,14 @@ def get_cargo_artifact_name(classifier: str) -> str: parser = ArgumentParser(formatter_class=ArgumentDefaultsHelpFormatter) parser.add_argument('--classifier', type=str, required=True) + parser.add_argument('--release', action=BooleanOptionalAction) args = parser.parse_args() - cmd = ['cargo', 'build', '--color=always', '--release'] + cmd = ['cargo', 'build', '--color=always'] + profile = 'debug' + if args.release: + profile = 'release' + cmd.append('--release') target = classifier_to_target(args.classifier) if target: @@ -71,7 +76,7 @@ def get_cargo_artifact_name(classifier: str) -> str: subprocess.run(cmd, cwd=basedir, check=True) artifact = get_cargo_artifact_name(args.classifier) - src = output / target / 'release' / artifact + src = output / target / profile / artifact dst = basedir / 'target' / 'classes' / 'native' / args.classifier / artifact dst.parent.mkdir(exist_ok=True, parents=True) shutil.copy2(src, dst)