<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I download maven libraries with dependencies? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-do-i-download-maven-libraries-with-dependencies/m-p/27025#M18942</link>
    <description>&lt;P&gt;I recommend creating a UBER jar or download jars offline use it in clusters when the maven becomes healthy again: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Install the MVN CLI tool on your local mac: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; brew install mvnvm&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Download the Artifact with all dependencies: &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;mvn dependency:get -DrepoUrl=http://packages.confluent.io/maven/ -DgroupId=org.apache.kafka -DartifactId=kafka_2.11 -Dversion=0.10.0.0-cp1&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;mvn dependency:get -DrepoUrl=http://packages.confluent.io/maven/ -DgroupId=org.apache.kafka -DartifactId=kafka_2.11 -Dversion=0.10.0.0-cp1&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Change directory into maven download repository and find the path of downloaded local path of repository: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;cd $HOME/.m2&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;find ./ -name kafka-clients-0.10.0.0-cp1*&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Copy the jar and dependencies to location /Users/user-gbth/mvn-lib-kafka/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;mkdir /Users/user-gbth/mvn-lib-kafka/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;cp /Users/user-gbth/.m2/repository/org/apache/kafka/kafka-clients/0.10.0.0-cp1/kafka-clients-0.10.0.0-cp1.jar /Users/gobinath/mvn-lib-kafka/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;mvn dependency:copy-dependencies -f /Users/user-gbth/.m2/repository/org/apache/kafka/kafka-clients/0.10.0.0-cp1/kafka-clients-0.10.0.0-cp1.pom -DoutputDirectory=/Users/user-gbth/mvn-lib-kafka/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;mvn dependency:copy-dependencies -f /Users/user-gbth/.m2/repository/org/apache/kafka/kafka-clients/0.10.0.0-cp1/kafka-clients-0.10.0.0-cp1.pom -DoutputDirectory=/Users/user-gbth/mvn-lib-kafka/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. Zip the file and import the zip file into Databricks. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;zip -r kafka-clients-0.10.0.0-cp1.zip /Users/gobinath/mvn-lib-kafka/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You can upload via UI or upload to the s3 bucket and load into databricks. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6) Load jars in databricks: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a) extract the zip to /databricks/jar location using databricks init script: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;#!/bin/bash
unzip /dbfs/path/kafka-clients-0.10.0.0-cp1.zip –d /databricks/jars/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b) or wrap it as UBER jar and attach to the library dependency list of the cluster. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://maven.apache.org/plugins/maven-shade-plugin/examples/includes-excludes.html" alt="https://maven.apache.org/plugins/maven-shade-plugin/examples/includes-excludes.html" target="_blank"&gt;https://maven.apache.org/plugins/maven-shade-plugin/examples/includes-excludes.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 07 May 2021 14:43:06 GMT</pubDate>
    <dc:creator>User16871418122</dc:creator>
    <dc:date>2021-05-07T14:43:06Z</dc:date>
    <item>
      <title>How do I download maven libraries with dependencies?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-do-i-download-maven-libraries-with-dependencies/m-p/27024#M18941</link>
      <description>&lt;P&gt;I want to import a maven library with its dependencies. How to do it? &lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 14:28:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-do-i-download-maven-libraries-with-dependencies/m-p/27024#M18941</guid>
      <dc:creator>User16871418122</dc:creator>
      <dc:date>2021-05-07T14:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I download maven libraries with dependencies?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-do-i-download-maven-libraries-with-dependencies/m-p/27025#M18942</link>
      <description>&lt;P&gt;I recommend creating a UBER jar or download jars offline use it in clusters when the maven becomes healthy again: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Install the MVN CLI tool on your local mac: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; brew install mvnvm&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Download the Artifact with all dependencies: &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;mvn dependency:get -DrepoUrl=http://packages.confluent.io/maven/ -DgroupId=org.apache.kafka -DartifactId=kafka_2.11 -Dversion=0.10.0.0-cp1&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;mvn dependency:get -DrepoUrl=http://packages.confluent.io/maven/ -DgroupId=org.apache.kafka -DartifactId=kafka_2.11 -Dversion=0.10.0.0-cp1&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Change directory into maven download repository and find the path of downloaded local path of repository: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;cd $HOME/.m2&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;find ./ -name kafka-clients-0.10.0.0-cp1*&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Copy the jar and dependencies to location /Users/user-gbth/mvn-lib-kafka/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;mkdir /Users/user-gbth/mvn-lib-kafka/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;cp /Users/user-gbth/.m2/repository/org/apache/kafka/kafka-clients/0.10.0.0-cp1/kafka-clients-0.10.0.0-cp1.jar /Users/gobinath/mvn-lib-kafka/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;mvn dependency:copy-dependencies -f /Users/user-gbth/.m2/repository/org/apache/kafka/kafka-clients/0.10.0.0-cp1/kafka-clients-0.10.0.0-cp1.pom -DoutputDirectory=/Users/user-gbth/mvn-lib-kafka/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;mvn dependency:copy-dependencies -f /Users/user-gbth/.m2/repository/org/apache/kafka/kafka-clients/0.10.0.0-cp1/kafka-clients-0.10.0.0-cp1.pom -DoutputDirectory=/Users/user-gbth/mvn-lib-kafka/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. Zip the file and import the zip file into Databricks. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;zip -r kafka-clients-0.10.0.0-cp1.zip /Users/gobinath/mvn-lib-kafka/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You can upload via UI or upload to the s3 bucket and load into databricks. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6) Load jars in databricks: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a) extract the zip to /databricks/jar location using databricks init script: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;#!/bin/bash
unzip /dbfs/path/kafka-clients-0.10.0.0-cp1.zip –d /databricks/jars/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b) or wrap it as UBER jar and attach to the library dependency list of the cluster. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://maven.apache.org/plugins/maven-shade-plugin/examples/includes-excludes.html" alt="https://maven.apache.org/plugins/maven-shade-plugin/examples/includes-excludes.html" target="_blank"&gt;https://maven.apache.org/plugins/maven-shade-plugin/examples/includes-excludes.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 14:43:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-do-i-download-maven-libraries-with-dependencies/m-p/27025#M18942</guid>
      <dc:creator>User16871418122</dc:creator>
      <dc:date>2021-05-07T14:43:06Z</dc:date>
    </item>
  </channel>
</rss>

