This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Setting up new Maven Installation and Local Repository -- How best to to it?

Posts: 1747
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been tasked with setting up a brand new Maven repository for our development team.

Yikes, but I've never used Maven!!!

We use both Intellij and Eclipse on our team if that makes any difference.


I'm still waiting for our team's exact requirements, but I believe we would want a local repository since the code is proprietary.

So, would the best way to proceed be to install Jenkins for a local repository and then fiddle around with Maven builds until it ... works?

The Apache maven tutorial looks good, but it's also a bit cryptic, maybe like Maven itself? A quick question that jumps out looking at the Apache site -- if I'm using an IDE like Intellij, do I have to install Maven separately like the Apache tutorial or is Maven really built in to modern IDEs?

Once installed, I'm guessing I can just use Maven directly from Intelij or from Eclipse, right?

I saw a decent chapter in the "Well Grounded Java Developer" that discusses Maven installations.

Look forward to any suggestions on how best to get started.


- Mike
Posts: 2759
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

If you install maven, it automatically sets up a repository on the local machine. You don't need to do anything. It's basically unzip and go. Eclipse comes with a plugin called m2eclipse that let's you import maven projects into eclipse and run maven builds from inside eclipse. The installation is pretty simple too. Just use eclipse update

You should be setting up a repository in your local network that mirrors public repositories and also contains your own artifacts. We are using artifactory. The installation for artifactory is pretty simple too. Just download the installer and execute it. It sets up everything for you

Jenkins is a CI server, not a maven repo. I haven't installed it myself, but someone else installed Hudson, and it was pretty simple too.

The way we have setup now is

A) we have artifactory that mirrors public repos, and also contains artifacts from 3rd party products that we have bought, and also out own artifacts
B) each developer has maven installed
C) most developers have eclipse + m2eclipse
D) the root Pom of our projects points to the artifactory, which mirrors public repos

Whenever someone does a build on their local, if an artifact is not in their local repo, maven asks artifactory for the artifact. Artifactory checks its own local repo. If its not there in the artifactory's repo, it gets it from the public repo and caches it in its own repo for next time.
Posts: 21757
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To get Maven running on a developer or build machine:

1. download/install a JDK
2. download/unzip Maven (on Linux, I place it in /usr/local).
3. Set JAVA_HOME environment variable to point to the installed JDK directory
3. Set MAVEN_HOME environment variable to point to the installed Maven directory.

To "prime the pump".

Pick a project, any project. As long as it has a pom.xml. run "mvn clean compile". Go to lunch while Maven downloads all the dependencies and caches them. Subsequent builds will use the cache and run much faster.

For a shared repository, I've been using Nexus, which allows me to post snapshot builds as sharable dependencies.
Posts: 5856
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I second Tim's recommendation for Nexus. And I also think that is what you really want when you wrote "setting up a brand new Maven repository for our development team". You would set up Nexus on a server in your company and then all of your developers would configure Maven to use your Nexus repository (instead of defaulting to Maven Central).

In our dev environment we store our sources in Subversion, use Jenkins to run the builds, and have our pom.xmls configured to "deploy" built artifacts to Nexus. This have been working very well for us. Each server (Subversion, Jenkins, Nexus) is running on its own machine (actually, they are all VMs in our private cloud), and we have additional VMs set up as Jenkins build slaves (some of our teams have very specific build environment requirements).
Mike London
Posts: 1747
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks or the great replies. I would have thanked everyone sooner, but my email address needed to be updated here on the ranch.

We should throw him a surprise party. It will cheer him up. We can use this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!