Downloading Maven artifacts
If you wish to download a Maven artifact directly from a Dist Maven repository (for example a Spring Boot fat JAR) you can construct a URL that will allow you to do so. You will need to ensure you have an access token (referred to as <access_token> below) with access to the requested repository that has at least the "Reader" permitted role. The following information will also be required:
- <organization>: Dist organization short name (i.e. <organization>.dist.cloud).
- <repository>: The repository short name.
- <group_id>: The Maven group ID. You need to replace "." characters with "/" characters in the group ID.
- <artifact_id>: The Maven artifact ID.
- <version>: The version string of the required artifact.
- <extension>: Typically .jar.
You can then construct a URL of the following format to access the required artifact: https://<organization>.maven.distrepos.com/<repository>/<group_id>/<artifact_id>/<version>/<artifact_id>-<version>.<extension>
You must use HTTP Basic Authentication to access this URL where the username is "dist" and the password is <access_token>.
A worked example using curl is as follows:
- Organization: Example (example.dist.cloud)
- Repository: maven-example
- Group ID: com.example
- Artifact ID: test
- Version: 1.0.0
- Extension: jar
- Access token: syinr3eolii6vjvdoodesxdo4v3zrc2vif5ebavucn477wy7e4xa
curl -u dist:syinr3eolii6vjvdoodesxdo4v3zrc2vif5ebavucn477wy7e4xa -O https://example.maven.distrepos.com/maven-example/com/example/test/1.0.0/test-1.0.0.jar
The following tools can assist with automating this process and may better suit your deployment process: