diff --git a/make/devkit/createJMHBundle.sh b/make/devkit/createJMHBundle.sh index 7018ae23e55..af29a0917d6 100644 --- a/make/devkit/createJMHBundle.sh +++ b/make/devkit/createJMHBundle.sh @@ -1,6 +1,6 @@ #!/bin/bash -e # -# Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -40,10 +40,22 @@ mkdir -p $BUILD_DIR $JAR_DIR cd $JAR_DIR rm -f * -wget https://repo.maven.apache.org/maven2/org/apache/commons/commons-math3/$COMMONS_MATH3_VERSION/commons-math3-$COMMONS_MATH3_VERSION.jar -wget https://repo.maven.apache.org/maven2/net/sf/jopt-simple/jopt-simple/$JOPT_SIMPLE_VERSION/jopt-simple-$JOPT_SIMPLE_VERSION.jar -wget https://repo.maven.apache.org/maven2/org/openjdk/jmh/jmh-core/$JMH_VERSION/jmh-core-$JMH_VERSION.jar -wget https://repo.maven.apache.org/maven2/org/openjdk/jmh/jmh-generator-annprocess/$JMH_VERSION/jmh-generator-annprocess-$JMH_VERSION.jar +fetchJar() { + url="https://repo.maven.apache.org/maven2/$1/$2/$3/$2-$3.jar" + if command -v curl > /dev/null; then + curl -O --fail $url + elif command -v wget > /dev/null; then + wget $url + else + echo "Could not find either curl or wget" + exit 1 + fi +} + +fetchJar org/apache/commons commons-math3 $COMMONS_MATH3_VERSION +fetchJar net/sf/jopt-simple jopt-simple $JOPT_SIMPLE_VERSION +fetchJar org/openjdk/jmh jmh-core $JMH_VERSION +fetchJar org/openjdk/jmh jmh-generator-annprocess $JMH_VERSION tar -cvzf ../$BUNDLE_NAME *