1#!/bin/bash 2# Set the version of JUnit and Mockito 3junit_version="4.13.1" 4mockito_version="1.10.19" 5cd ../ 6# Function to download a JAR if not available 7download_jar() { 8 local jar_name="$1" 9 local jar_filename="$2" 10 local download_url="$3" 11 12 if [ ! -f "lib/$jar_filename" ]; then 13 echo "Downloading $jar_name..." 14 wget "$download_url" -P lib 15 else 16 echo "$jar_name already exists in lib directory." 17 fi 18} 19 20# Check and download JUnit&Mockito JAR 21download_jar "JUnit" "junit-$junit_version.jar" "https://repo1.maven.org/maven2/junit/junit/$junit_version/junit-$junit_version.jar" 22download_jar "Mockito" "mockito-all-$mockito_version.jar" "https://repo1.maven.org/maven2/org/mockito/mockito-all/$mockito_version/mockito-all-$mockito_version.jar" 23 24# Run the mvn install command for the Snapshot jars 25cd ../ 26mvn clean install 27