Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the fastest way to get a private Maven Repository up and running?

I'm working with a few developers and we would like to share some jars as we're working through the early iteration of a projects code. We would like to just pop up a quick private maven repository server to use for a short bit. In ruby it's a simple as typing:

gem server

Apparently, there's no?

mvn server

Even a simple maven dependency to github would be workable for a short bit. Apparently, there is no main-stream reliable maven plug-in for that either?

gem 'nokogiri', :git => 'https://github.com/tenderlove/nokogiri.git', :branch => '1.4'

The simplest answer I found is here: Hosting a Maven repository on github.

Of course one of the answers in the above StackOverflow reference is in the vein "Oh don't do that! It's very bad!". Well no duh! I got the impression that generally people didn't want to do it, but there wasn't a quicker and simpler choice for a minimal small solution.

Is there?

Michael Corleone: Just when I thought I was out... they pull me back in to code Java again.

like image 283
robdbirch Avatar asked Jan 19 '15 19:01

robdbirch


3 Answers

Consider using one of the following:

  • Nexus
  • Artifactory
  • Archiva
  • Reposilite

They are easy to install (I run Nexus on my development machine to keep an off-line copy of my dependencies). Nexus is built by the guys who invented Maven and has a book available:

  • http://books.sonatype.com/nexus-book/reference/

You can use Nexus (and Artifactory pro version) to host both your java jars and your ruby gems.

In conclusion, comparing the above products to "gem server" is inadequate. They're more like geminabox with more features.

like image 199
Mark O'Connor Avatar answered Oct 11 '22 01:10

Mark O'Connor


Have a look at Reposilite. Download the jar and run

java -Dreposilite.port=8080 -jar reposilite-<VERSION>.jar

and check http://localhost:8080

For more information look at Reposilite documentation and this article.

like image 27
Dmitry Pavlenko Avatar answered Oct 11 '22 03:10

Dmitry Pavlenko


If your repositories are already on GitHub then the fastest way to share their Maven artifacts is with JitPack.

There's not much setup on your part, you just add this to pom.xml:

  1. Add repository:
<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>
  1. Add dependency
<dependency>
    <groupId>com.github.User</groupId>
    <artifactId>Repository</artifactId>
    <version>Tag</version>
</dependency>

The way it works is - JitPack checks out code from GitHub and builds it. All the Maven artifacts from the build get published.

like image 38
Andrejs Avatar answered Oct 11 '22 03:10

Andrejs