Skip to content

Instantly share code, notes, and snippets.

@skaronn
Created August 27, 2018 22:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skaronn/4d0a14b951c04694085309d236da7be1 to your computer and use it in GitHub Desktop.
Save skaronn/4d0a14b951c04694085309d236da7be1 to your computer and use it in GitHub Desktop.
MapR Drill JDBC Driver maven dependencies installer
#!/usr/bin/env bash
# http://package.mapr.com/tools/MapR-JDBC/MapR_Drill/
readonly mapr_jdbc_folder="DrillJDBC41"
readonly jars=$(find ${mapr_jdbc_folder} -name "*.jar")
readonly group_id="mapr.drill.jdbc"
readonly version="1.4.1.1001"
readonly mapr_drill_jdbc_driver_install="mapr-drill-jdbc-maven-dependencies.sh"
readonly partial_pom="partial-pom.xml"
if [ -f "${partial_pom}" ] ; then
rm -f "${partial_pom}"
fi
if [ -f "${mapr_drill_jdbc_driver_install}" ] ; then
rm -f "${mapr_drill_jdbc_driver_install}"
fi
for jar_file in `find ${mapr_jdbc_folder} -name "*jar"` ; do
jar_file_name=${jar_file%.jar}
artifact="${jar_file_name##*/}"
artifact_id="${artifact##-*}"
echo "<dependency>" >> "${partial_pom}"
echo " <groupId>${group_id}</groupId>" >> "${partial_pom}"
echo " <artifactId>${artifact_id}</artifactId>" >> "${partial_pom}"
echo " <version>${version}</version>" >> "${partial_pom}"
echo "</dependency>" >> "${partial_pom}"
echo "" >> "${partial_pom}"
echo "mvn install:install-file -Dfile=${jar_file} -DgroupId=${group_id} -DartifactId=${artifact_id} -Dversion=${version} -Dpackaging=jar" >> "${mapr_drill_jdbc_driver_install}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment