«

Hosting a Private Maven Repository

Overview

My Datomic provides a Maven repository for acquiring the datomic-pro dependency. You may wish to host your own private Maven repository to maintain control over availability of the dependencies and to take ownership of availability of the artifacts.

A maven repository can be as simple as a remotely accessible storage with your dependencies, pom(s) and checksums of those files in the correct directory. This document will describe how to gather the necessary files and where to put them. Choosing a storage and managing access to that storage is not discussed and is the responsibility of the user. Storage permissions must be restricted to licensees and breaches of this boundary may result in termination of your license.

Datomic may be redistributed after version 1.0.6711. Familiarize yourself with the Apache 2.0 agreement before proceeding with this guide. These instructions are solely for the purpose of internal and private distribution of the dependencies.

Gathering Dependencies

You will need to gather the dependencies, their pom and then generate checksums for the jar and pom.

In the instructions below either replace $THIS with the correct information or export that to an environment variable before continuing with the instructions.

The instructions are listed here to give an overview of what needs to be done for this process. These instructions can be integrated into your environment through the automation systems that you have in place for consuming new versions of Datomic.

  • Login to My Datomic
    • Note the e-mail address used to login to your account.
    • Note the Download Key under "License Information"
  • Download the datomic-pro dependency (Instructions for this are listed on the my.datomic.com account page)

    wget --http-user=your@email.com --http-password=$YOUR_DOWNLOAD_KEY https://my.datomic.com/repo/com/datomic/datomic-pro/$VERSION/datomic-pro-$VERSION.zip -O datomic-pro-$VERSION.zip
    
    • Substitute $YOUR_DOWNLOAD_KEY and $VERSION with the appropriate values, or export those to your environment and assign them the appropriate value.
  • Unzip datomic-pro-$VERSION.zip in your preferred location.
  • Navigate to that path in your shell.
  • Download memcache-asg-java-client artifacts
    • Make a directory for the artifacts: mkdir memcache-asg-java-client
    • Note the latest version of the memcache-asg-java-client in the release notes for your version of Datomic. You may need to look at previous versions to see when the last update was to this dependency.
    • From the path where datomic-pro-$VERSION.zip was unzipped to: Download the memcache-asg-java-client-$MAJC_VERSION.jar

      wget --http-user=your@email.com --http-password=$YOUR_DOWNLOAD_KEY https://my.datomic.com/repo/com/datomic/memcache-asg-java-client/$MAJC_VERSION/memcache-asg-java-client-$MAJC-VERSION.jar -O memcache-asg-java-client/memcache-asg-java-client-$MAJC_VERSION.jar
      
    • From the path where datomic-pro-$VERSION.zip was unzipped to: Download the pom to memcache-asg-java-client-$MAJC_VERSION.pom

      wget --http-user=your@email.com --http-password=$YOUR_DOWNLOAD_KEY https://my.datomic.com/repo/com/datomic/memcache-asg-java-client/$MAJC_VERSION/memcache-asg-java-client-$MAJC-VERSION.pom -O memcache-asg-java-client/memcache-asg-java-client-$MAJC-VERSION.pom
      
  • Generate the files which will be deployed to your storage
    • Make the repository directory: mkdir repo
    • Install datomic-pro to the above local repo (replace $VERSION with your version if you're not using an environment variable for $VERSION):

      mvn install:install-file -DgroupId=com.datomic -DartifactId=datomic-pro -Dfile=datomic-pro-$VERSION.jar -DpomFile=pom.xml -DlocalRepositoryPath=$(pwd)/repo -DcreateChecksum=true~
      
    • Install memcache-asg-java-client to the above local repo (replace $VERSION with your version if you're not using an environment variable for $VERSION):

      mvn install:install-file -DgroupId=com.datomic -DartifactId=memcache-asg-java-client -Dfile=memcache-asg-java-client/memcache-asg-java-client-$MAJC_VERSION.jar -DpomFile=memcache-asg-java-client/memcache-asg-java-client-$MAJC_VERSION.pom -DlocalRepositoryPath=$(pwd)/repo -DcreateChecksum=true~
      

You should now have a /repo directory with the necessary datomic-pro and memcache-asg-java-client files to act as a maven repository for Datomic Pro.

Deploy

Deploying your private maven repository only requires that you copy the repo directory you just created to your preferred restricted remote storage.

If you use a dependency caching system then you may be required to have a maven index. Follow the directions for the Maven Indexer and deploy this to root of your maven repository.

Usage

Once your storage has your /repo directory copied to it, access is limited and you're able to access the storage from trusted environments then you can use the repository.

Setup your dependency management to use your storage location as a maven repository. An example for tools.deps:

{:mvn/repos {"my.private.repo" {:url "protocol://path/to/storage"}}
 :deps {com.datomic/datomic-pro {:mvn/version "${VERSION}"}}}