metriql / metriql

The metrics layer for your data. Join us at https://metriql.com/slack
https://metriql.com
Apache License 2.0
295 stars 23 forks source link

Building Metriql With Local, Proprietary JAR File #73

Closed lmabraidofandino closed 2 years ago

lmabraidofandino commented 2 years ago

RESOLVED: We're developing an Impala adapter to use with metriql. Impala's JAR file is proprietary and not available in Maven repositories, so we tried passing its location in the command that does a clean install of metriql within mvnw.cmd. When the script substitutes values for the environment variables, this command is

"C:\Program Files\Java\jdk-11.0.14\bin\java.exe" -classpath "C:\path_to_my_metriql_code.mvn\wrapper\maven-wrapper.jar" "-Dmaven.multiModuleProjectDirectory=C:\path_to_my_metriql_code" "-Dhttp.proxyHost=my_proxy_server.com" "-Dhttp.proxyPort=8080" "-Dhttps.proxyHost=my_proxy_server.com" "-Dhttps.proxyPort=8080" org.apache.maven.wrapper.MavenWrapperMain -Dfile=C:\path_to_my_Impala_JAR_file -DgroupId=com.cloudera.impala.jdbc -DartifactId=ImpalaJDBC42 -Dversion=2.6.15.1017 clean install -DskipTests

The wrapper still attempts to download the Impala JAR file from https://repo.maven.apache.org/maven2. If we remove the dependency from our Impala adapter's pom.xml file, compilation fails because it cannot find the class defined in the Impala JAR file, com.cloudera.impala.jdbc.Driver. We use this class in our Impala adapter's Warehouse.kt file.

How can we build metriql using a local, proprietary JAR file on which our adapter depends?

This issue is also posted in your Slack channel, help-and-feedback.

SOLUTION: Add the following to the project's pom.xml so it will use the local JAR file.

com.cloudera.impala.jdbc ImpalaJDBC42 2.6.15.1017 system C:/path_to_jar_file/ImpalaJDBC42.jar

Other options are discussed in https://mkyong.com/maven/how-to-add-oracle-jdbc-driver-in-your-maven-local-repository/ (edited)

buremba commented 2 years ago

Hey, glad that it's solved. Feel free to open the issue if you run into another issue.