Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including @mahisoft/mvn-artifact-url with all npm packages installed. Try it out:

var mvnArtifactUrl = require("@mahisoft/mvn-artifact-url")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@mahisoft/mvn-artifact-url v4.0.1

Create url for maven artifacts

mvn-artifact-url

travis npm

Install

$ npm install --save mvn-artifact-url

Usage

import url from 'mvn-artifact-url';

let artifact = {
  groupId: 'org.apache.commons',
  artifactId: 'commons-lang3',
  version: '3.4',
};

url(artifact).then(resolved => {
  resolved;
  //=> 'https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4.jar'
});

url(artifact, 'http://localhost/').then(resolved => {
  resolved;
  //=> 'http://localhost/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4.jar'
});

// SNAPSHOT releases gets resolved.
url({
  groupId: 'org.apache.commons',
  artifactId: 'commons-lang3',
  version: '3.4',
  isSnapShot: true,
}).then(resolved => {
  resolved;
  //=> 'https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.4-SNAPSHOT/commons-lang3-3.4-1-23.jar'
});

License

MIT © Sigurd Fosseng

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free