Find file History

README.asciidoc

simpligility technologies inc. presents

Maven Repository Provisioner

Introduction

A command line tool and library from the Maven Repository Tools project to provision a component and all its transitive dependencies from a source Maven repository to a target Maven repository. Both are accessed via HTTP/HTTPS using the normal Maven interactions.

It can also be used to deploy a local, file-system directory using the Maven repository format to a repository manager.

Use Cases

  • Provision a repository to contain only "approved" components

  • Create a repository that contains a product and all its dependencies for archival, software escrow, auditing or similar compliance related reasons

  • Transfer components and all needed dependencies between repositories or repository managers without using migration tools

Features

  • Command line tool with built-in help

  • Resolves specified component including transitive dependencies and parent pom’s required

  • All coordinates can be used to specify component - groupId, artifactId, version, classifier, packaging/extension

  • Allows processing of multiple components in one run

  • Optionally includes javadoc and sources JAR files

  • Optionally include dependencies with scope provided

  • Source repository defaults to the Central Repository, but can be configured

  • Target repository can be a file location or a repository manager repository

  • Authentication for repository manager deployment can be configured

  • Temporary cache directory on local disk for inspection local-cache

  • Logging to stdout as well as log file maven-repository-provisioner.log

  • Exit codes to signal success or failure

  • Strict adherence to Maven repository format specs in terms of file names

  • Check target repository for POM file and skips repeated deployments

  • Verify only mode allowing to download and report on potential deployments after checking target repository

Download

Get the *-jar-with-dependencies.jar of the latest version available from http://repo1.maven.org/maven2/com/simpligility/maven/maven-repository-provisioner/

Usage

Java 8 or higher is required.

The command

java -jar maven-repository-provisioner-*-jar-with-dependencies.jar

shows the documentation. A full example invocation could look like this:

java - jar maven-repository-provisioner-*-jar-with-dependencies.jar
     -a "com.simpligility.maven:progressive-organization-pom:pom:2.3.0"
     -t "http://localhost:8081/nexus/content/repositories/test"
     -u admin
     -p admin123
     -s "http://localhost:8081/nexus/content/groups/public/"

To provision an existing Maven repository from the filesystem into a target repository, simply specify the path to the folder as the local cache and omit the artifact coordinates:

java - jar maven-repository-provisioner-*-jar-with-dependencies.jar
     -cd "/opt/maven-repo"
     -t "http://localhost:8081/nexus/content/repositories/test"
     -u admin
     -p admin123

See the test.sh script for a number of further examples. Syntax for artifact (-a) or lists of artifacts is "g:a[:extension][:classifier]:v|g:a[:extension][:classifier]:v".

If you need to access the source repository via a proxy server, you can configure the standard Java proxy parameters:

http.proxyHost
http.proxyPort
http.proxyUser
http.proxyPassword

Find more information about these properties in the Java documentation.