Do not download events-broker from maven during local setup

Events-broker library is no longer maven project, this means new
artifacts are not published to the maven repository.
During the local setup use locally built version of events-broker
instead of downloading it from maven.

Change-Id: Ie98e1eca5eef1f6f3a768e4b2d8947d18a48d58f
diff --git a/setup_local_env/setup.sh b/setup_local_env/setup.sh
index cef35c0..38c4d04 100755
--- a/setup_local_env/setup.sh
+++ b/setup_local_env/setup.sh
@@ -19,7 +19,6 @@
 GERRIT_BRANCH=stable-3.4
 GERRIT_CI=https://archive-ci.gerritforge.com/view/Plugins-$GERRIT_BRANCH/job
 LAST_BUILD=lastSuccessfulBuild/artifact/bazel-bin/plugins
-EVENTS_BROKER_VER=`grep 'com.gerritforge:events-broker' $(dirname $0)/../external_plugin_deps.bzl | cut -d '"' -f 2 | cut -d ':' -f 3`
 GLOBAL_REFDB_VER=`grep 'com.gerritforge:global-refdb' $(dirname $0)/../external_plugin_deps.bzl | cut -d '"' -f 2 | cut -d ':' -f 3`
 
 function check_application_requirements {
@@ -234,6 +233,7 @@
     echo
     echo "[--release-war-file]            Location to release.war file"
     echo "[--multisite-lib-file]          Location to lib multi-site.jar file"
+    echo "[--eventsbroker-lib-file]       Location to lib events-broker.jar file"
     echo
     echo "[--new-deployment]              Cleans up previous gerrit deployment and re-installs it. default true"
     echo "[--get-websession-plugin]       Download websession-broker plugin from CI lastSuccessfulBuild; default true"
@@ -287,6 +287,11 @@
     shift
     shift
   ;;
+  "--eventsbroker-lib-file" )
+    EVENTS_BROKER_LIB_LOCATION=$2
+    shift
+    shift
+  ;;
   "--gerrit-canonical-host" )
     export GERRIT_CANONICAL_HOSTNAME=$2
     shift
@@ -388,6 +393,7 @@
 
 RELEASE_WAR_FILE_LOCATION=${RELEASE_WAR_FILE_LOCATION:-bazel-bin/release.war}
 MULTISITE_LIB_LOCATION=${MULTISITE_LIB_LOCATION:-bazel-bin/plugins/multi-site/multi-site.jar}
+EVENTS_BROKER_LIB_LOCATION=${EVENTS_BROKER_LIB_LOCATION:-bazel-bin/plugins/events-broker/events-broker.jar}
 
 
 export FAKE_NFS=$COMMON_LOCATION/fake_nfs
@@ -409,6 +415,10 @@
 else
   cp -f $MULTISITE_LIB_LOCATION $DEPLOYMENT_LOCATION/multi-site.jar  >/dev/null 2>&1 || { echo >&2 "$MULTISITE_LIB_LOCATION: Not able to copy the file. Aborting"; exit 1; }
 fi
+
+echo "Copying events-broker library"
+  cp -f $EVENTS_BROKER_LIB_LOCATION $DEPLOYMENT_LOCATION/events-broker.jar  >/dev/null 2>&1 || { echo >&2 "$EVENTS_BROKER_LIB_LOCATION: Not able to copy the file. Aborting"; exit 1; }
+
 if [ $DOWNLOAD_WEBSESSION_PLUGIN = "true" ];then
   echo "Downloading websession-broker plugin $GERRIT_BRANCH"
   wget $GERRIT_CI/plugin-websession-broker-bazel-$GERRIT_BRANCH/$LAST_BUILD/websession-broker/websession-broker.jar \
@@ -437,11 +447,6 @@
   -O $DEPLOYMENT_LOCATION/global-refdb.jar || { echo >&2 "Cannot download global-refdb library: Check internet connection. Abort\
 ing"; exit 1; }
 
-echo "Downloading events-broker library $GERRIT_BRANCH"
-  wget https://repo1.maven.org/maven2/com/gerritforge/events-broker/$EVENTS_BROKER_VER/events-broker-$EVENTS_BROKER_VER.jar \
-  -O $DEPLOYMENT_LOCATION/events-broker.jar || { echo >&2 "Cannot download events-broker library: Check internet connection. Abort\
-ing"; exit 1; }
-
 if [ "$BROKER_TYPE" = "kafka" ]; then
 echo "Downloading events-kafka plugin $GERRIT_BRANCH"
   wget $GERRIT_CI/plugin-events-kafka-bazel-$GERRIT_BRANCH/$LAST_BUILD/events-kafka/events-kafka.jar \