10

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.

Community
  • 1
  • 1
robdbirch
  • 498
  • 5
  • 12
  • Thanks again to everybody for the great help. I put together a little cheat sheet to get people [Up and Running with a Maven Repo in about 15 minutes](https://coderwall.com/p/fqvhhw/maven-repository-in-less-than-15-minutes). – robdbirch Jan 21 '15 at 14:34

3 Answers3

4

Consider using one of the following:

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:

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.

dzikoysk
  • 1,560
  • 1
  • 15
  • 27
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
  • 3
    Thanks for the response. I looked at Nexus, for about 15 minutes and I wasn't able to be up in running and deploying jars despite their 2 minute videos. It seemed a bit more heavy weight for what I needed. Serving gems on Nexus, don't see that ever happening. – robdbirch Jan 19 '15 at 20:01
  • @RobertBirch Really, you couldn't install Nexus? Why not spend 2 minutes reading the documentation instead. http://books.sonatype.com/nexus-book/reference/install.html As for heavyweight... I assure you it's one of the most lightweight and reliable apps I have ever run in production. – Mark O'Connor Jan 19 '15 at 20:07
  • 1
    No, it downloaded and installed, but configuring and managing and reading all the docs, is not up and running in reasonable amount of time. Actually, Archiva looks simpler. Or at least everything is on one page and doesn't span mid sectionChapter 3 + section/chapter 4 like the Nexus docs. Looking at Artifactory in a bit. – robdbirch Jan 19 '15 at 20:33
3

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.

Dmitry Pavlenko
  • 8,530
  • 3
  • 30
  • 38
2

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.

Andrejs
  • 26,885
  • 12
  • 107
  • 96