Support Questions

Find answers, ask questions, and share your expertise

How do I resolve maven dependencies for building application on HDP stack?

avatar
Explorer

Two ways to deal with this

  1. If you have a internal maven repository manger like Sonatype Nexus, one can setup a proxy pointing to http://repo.hortonworks.com/content/repositories/releases/ and internally add it to the nexus maven repository groups.
  2. If one doesn't have any type of maven repository manager they can directly use the public groups url "http://repo.hortonworks.com/content/groups/public/" in there maven settings.xml as a mirror
1 ACCEPTED SOLUTION

avatar

Example Maven Section:

<repositories>
    <repository>
        <releases>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
            <checksumPolicy>warn</checksumPolicy>
        </releases>
        <snapshots>
            <enabled>false</enabled>
            <updatePolicy>never</updatePolicy>
            <checksumPolicy>fail</checksumPolicy>
        </snapshots>
        <id>HDPReleases</id>
        <name>HDP Releases</name>
        <url>http://repo.hortonworks.com/content/repositories/releases/</url>
        <layout>default</layout>
    </repository>
...

View solution in original post

4 REPLIES 4

avatar

Example Maven Section:

<repositories>
    <repository>
        <releases>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
            <checksumPolicy>warn</checksumPolicy>
        </releases>
        <snapshots>
            <enabled>false</enabled>
            <updatePolicy>never</updatePolicy>
            <checksumPolicy>fail</checksumPolicy>
        </snapshots>
        <id>HDPReleases</id>
        <name>HDP Releases</name>
        <url>http://repo.hortonworks.com/content/repositories/releases/</url>
        <layout>default</layout>
    </repository>
...

avatar
Explorer

If there is a reason for not touching the project's pom.xml one could fix their maven settings.xml to mirror http://repo.hortonworks.com/content/groups/public/ and direct all the maven requests

avatar
Expert Contributor

Thank you @gkesavan, here is the entry which worked for me:

   <mirror>
      <id>hw_central</id>
      <name>Hortonworks Mirror of Central</name>
      <url>http://repo.hortonworks.com/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>
   </mirror>

avatar
Explorer

example on how to user mirror in maven settings.xml : https://maven.apache.org/guides/mini/guide-mirror-settings.html