You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by Juho Autio <ju...@rovio.com> on 2019/10/29 22:34:27 UTC

Building Atlas from source

Hello!

I wanted to build the current branch-2.0 of Atlas but it didn't work
simply by following the Build Process of README.txt.

The reason for wanting to build from source is that
spark-atlas-connector recommends using Atlas 2.1.0 (
https://github.com/hortonworks-spark/spark-atlas-connector#create-atlas-models
), but I couldn't find such release. Not released yet?

So, to build Atlas from source I tried:

    mvn clean install

..but it failed with errors like:

    [ERROR] Failed to execute goal on project atlas-testtools: Could
not resolve dependencies for project
org.apache.atlas:atlas-testtools:jar:2.1.0-SNAPSHOT: The following
artifacts could not be resolved:
org.restlet.jee:org.restlet:jar:2.3.0,
org.restlet.jee:org.restlet.ext.servlet:jar:2.3.0: Could not find
artifact org.restlet.jee:org.restlet:jar:2.3.0 in central
(https://repo1.maven.org/maven2) -> [Help 1]

This way I got a bit further with the build:

    mvn -s ~/.m2/settings-apache-atlas.xml clean install -DskipTests=true

This failure I manually mitigated by removing hortonworks-nexus from
the settings as far as it wasn't absolutely required for finding some
dependency (and I had previously fetched that to the local .m2/):

    [ERROR] Failed to execute goal
org.apache.maven.plugins:maven-site-plugin:3.7:site (default) on
project atlas-docs: SiteToolException: The site descriptor cannot be
resolved from the repository: ArtifactResolutionException: Unable to
locate site descriptor: Could not transfer artifact
org.apache:apache:xml:site_en:17 from/to hortonworks-nexus
(http://nexus-private.hortonworks.com/nexus/content/groups/public/):
Connect to nexus-private.hortonworks.com:80
[nexus-private.hortonworks.com/54.173.242.72] failed: Operation timed
out (Connection timed out)

I wonder what would be a proper way to manage that ( maybe this:
https://stackoverflow.com/a/41810983/1068385 – but might be not
enough).

Having hortonworks-nexus is slowing down dependency fetching a lot
whenever the dependency is not found in central. Maybe it could be
avoided by adding all of these explicitly before it:

https://repo.hortonworks.com/content/repositories/releases/
https://repository.apache.org/content/groups/snapshots/
https://repository.apache.org/content/groups/staging/
https://repository.apache.org/content/groups/public/
https://maven.java.net/content/groups/public/
https://repository.jboss.org/nexus/content/groups/public/

..I didn't try that though.

Is there some official way configure the maven repos for an Atlas
build? Could the project pom.xml define the required maven repos? If
there's some automated CI builder for Atlas, how does that work?

Also, README.txt instructs to build with 'mvn install' first, and only
then 'package -Pdist'. Is 'install' (to local .m2) really required for
building the packages?

Thanks!


I used the following settings, saved as ~/.m2/settings-apache-atlas.xml:

<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0
http://maven.apache.org/xsd/settings-1.1.0.xsd"
xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <profiles>
    <profile>
      <id>atlas</id>
      <repositories>
        <repository>
          <id>central</id>
          <name>Maven Central</name>
          <url>http://repo1.maven.org/maven2</url>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>
        <repository>
          <id>oracleReleases</id>
          <name>Oracle Released Java Packages</name>
          <url>http://download.oracle.com/maven</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots/>
        </repository>
        <repository>
          <id>maven.restlet.org</id>
          <name>maven.restlet.org</name>
          <url>http://maven.restlet.org</url>
          <releases>
            <enabled>true</enabled>
          </releases>
        </repository>
        <repository>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
          <id>clojars</id>
          <url>https://clojars.org/repo/</url>
        </repository>
        <!--
        <repository>
          <id>hortonworks-nexus</id>
          <name>nexus repo</name>
          <url>http://nexus-private.hortonworks.com/nexus/content/groups/public/</url>
        </repository>
        -->
      </repositories>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>atlas</activeProfile>
  </activeProfiles>
</settings>