Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 1.64 KB

readme.md

File metadata and controls

56 lines (40 loc) · 1.64 KB

Dockerized Mock for Nexus API

Building Roboconf's Docker images requires an internet connection to retrieve the last artifacts from Sonatype's OSS repository. However, there are times where we would like to use locally built Maven artifacts.

This project aims at mocking Nexus' Core API to download local Maven artifacts.
The server can be launched manually with NodeJS or embedded in a Docker image.

For the moment, only the redirect operation is implemented.
The LATEST value is not supported when resolving artifacts.

Build it

docker build -t roboconf/mock-for-nexus-api .

Run it

# Add a volume to load the local Maven repository.
# The volume is read-only.
# Make the API available on the 9090 port.
# The container will run in background and be deleted automatically once stopped.
docker run -d --rm -p 9090:9090 -v /home/me/.m2:/home/maven:ro roboconf/mock-for-nexus-api

Access the API

The API will be available by default at http://localhost:9090/redirect
Example of GET request (to run in your web browser).

http://localhost:9090/redirect?g=net.roboconf&r=releases&a=roboconf-karaf-dist-dm&v=0.9-SNAPSHOT&p=tar.gz

Run the Server without Docker

Assuming you have NodeJS installed...

# Start the server
npm start

... or...

# To start the server while watching file edition
npm run dev