Publish Jar to Local Mave

Example shell:

_install_lucene_thorg(){
  artifact_id="${1:?Artifact id is required as first argument for ${FUNCNAME[0]}}"
  jar_file="${2:?Jar file is required as second argument for ${FUNCNAME[0]}}"

  install_if_missing maven mvn

  if [[ ! -f "${jar_file}" ]]
  then
  	echo.red "File ${jar_file} does NOT exists. Have you ran ./_build.sh?"
    return 1
  fi

  mvn install:install-file \
    -Dfile="${jar_file:?}" \
    -DgroupId="org.apache.lucene.thorg_lucene" \
    -DartifactId="${artifact_id:?}" \
    -Dversion="${LUCENE_VERSION:?}" \
    -Dpackaging=jar \
    -DgeneratePom=true || return 1

  echo "Published ${jar_file} to local maven repo"
}

_install_lucene_thorg \
  lucene-core "${LUCENE_LUCENE_DIR:?}/build/core/lucene-core-7.3.0-SNAPSHOT.jar" \
  || return 1