storj.io/minio@v0.0.0-20230509071714-0cbc90f649b1/mint/build/minio-java/install.sh (about) 1 #!/bin/bash -e 2 # 3 # Mint (C) 2017 Minio, Inc. 4 # 5 # Licensed under the Apache License, Version 2.0 (the "License"); 6 # you may not use this file except in compliance with the License. 7 # You may obtain a copy of the License at 8 # 9 # http://www.apache.org/licenses/LICENSE-2.0 10 # 11 # Unless required by applicable law or agreed to in writing, software 12 # distributed under the License is distributed on an "AS IS" BASIS, 13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 # See the License for the specific language governing permissions and 15 # limitations under the License. 16 # 17 18 SPOTBUGS_VERSION="4.2.2" ## needed since 8.0.2 release 19 JUNIT_VERSION="4.12" ## JUNIT version 20 MINIO_JAVA_VERSION=$(curl --retry 10 -s "https://repo1.maven.org/maven2/io/minio/minio/maven-metadata.xml" | sed -n "/<latest>/{s/<.[^>]*>//g;p;q}" | sed "s/ *//g") 21 if [ -z "$MINIO_JAVA_VERSION" ]; then 22 echo "unable to get latest minio-java version from maven" 23 exit 1 24 fi 25 26 test_run_dir="$MINT_RUN_CORE_DIR/minio-java" 27 git clone --quiet https://github.com/minio/minio-java.git "$test_run_dir/minio-java.git" 28 (cd "$test_run_dir/minio-java.git"; git checkout --quiet "tags/${MINIO_JAVA_VERSION}") 29 $WGET --output-document="$test_run_dir/minio-${MINIO_JAVA_VERSION}-all.jar" "https://repo1.maven.org/maven2/io/minio/minio/${MINIO_JAVA_VERSION}/minio-${MINIO_JAVA_VERSION}-all.jar" 30 $WGET --output-document="$test_run_dir/spotbugs-annotations-${SPOTBUGS_VERSION}.jar" "https://repo1.maven.org/maven2/com/github/spotbugs/spotbugs-annotations/${SPOTBUGS_VERSION}/spotbugs-annotations-${SPOTBUGS_VERSION}.jar" 31 $WGET --output-document="$test_run_dir/junit-${JUNIT_VERSION}.jar" "https://repo1.maven.org/maven2/junit/junit/${JUNIT_VERSION}/junit-${JUNIT_VERSION}.jar" 32 javac -cp "$test_run_dir/minio-${MINIO_JAVA_VERSION}-all.jar:$test_run_dir/spotbugs-annotations-${SPOTBUGS_VERSION}.jar:$test_run_dir/junit-${JUNIT_VERSION}.jar" "${test_run_dir}/minio-java.git/functional"/*.java 33 cp -a "${test_run_dir}/minio-java.git/functional"/*.class "$test_run_dir/" 34 rm -fr "$test_run_dir/minio-java.git"