Skip to content

Build Drill in a Corporate Environment

Paul Rogers edited this page Nov 13, 2019 · 3 revisions

Some corporations are quite strict about Maven dependencies, routing all requests through a local artifactory such as JFrog. When this occurs, JFrog must be configured to proxy each authorized repository. However, Drill uses some "oddball" repos that are not likely available in the local corporate proxy. These are the tricks I used to work around the issues.

First, notice the build failures. For me it was:

[ERROR] Failed to execute goal on project drill-logical:
   Could not resolve dependencies for project org.apache.drill:drill-logical:jar:1.17.0-SNAPSHOT:
   Could not find artifact com.github.vvysotskyi.drill-calcite:calcite-core:jar:1.20.0-drill-r2
   in repo (https://mycompany.jfrog.io/mycompany/repo)
[ERROR] Failed to execute goal on project drill-java-exec:
   Could not resolve dependencies for project org.apache.drill.exec:drill-java-exec:jar:1.17.0-SNAPSHOT:
   Failure to find org.kohsuke:libpam4j:jar:1.8-rev2
   in https://mycompany.jfrog.io/mycompany/repo was cached in the local repository,
   resolution will not be reattempted until the update interval of repo has elapsed or updates are forced -> [Help 1]

The correct long-term solution is to obtain proper permissions, then configure JFrog to host Drill's specialized repos. A quick-and-dirty solution is to change the Maven configuration to bypass the corporate artifactory.

Drill stores a fork of Calcite in an ad-hoc repo. If we look in drill-root/pom.xml, we see that jitpack.io is the repo where Drill stores its Calcite fork.

A Google search for org.kohsuke:libpam4j:jar:1.8-rev2 reveals that it is hosted in the MapR public repo, defined as:

    <repository>
      <id>mapr-releases</id>
      <url>http://repository.mapr.com/maven/</url>
    </repository>

To exclude this specialized repos:

cd ~/.m2
vi settings.xml

Change the following to exclude jitpack.io and mapr-releases:

  <mirrors>
    <mirror>
      <mirrorOf>!jitpack.io,!mapr-releases,*</mirrorOf>
      <name>repo</name>
      <url>https://mycompany.jfrog.io/mycompany/repo</url>
      <id>repo</id>
    </mirror>
  </mirrors>
Clone this wiki locally