Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to index a Maven repo without Nexus/Artifactory/etc?

I run my own little Maven repo for some open source. I have no dedicated server so I use a Google code repository, deploy to file system and then commit and push. Works perfect for me.

But some Maven tools are looking for a nexus-maven-repository-index.properties and the index (in GZ). I would like to generate this index to

  1. get rid of the warning that it's not here
  2. Maven doesn't try the repo for artefacts that are not there.

How can I do that? Is there a tool (Java main) that is able to generate an index? Also tips how to use the proper Nexus Jars with a little commandline tool are welcome.

like image 278
Peter Kofler Avatar asked Mar 18 '11 07:03

Peter Kofler


1 Answers

I came across this post while I was searching for a solution to add a local repository to my Maven project using IntelliJ Idea.

Since Sonatype changed their paths and reorganized the downloads since the last post, here is an updated step-by-step tutorial to get your repository indexed for use with IntelliJ Idea:

  1. Download the latest stand-alone indexer from here.
  2. Extract it somewhere and go into this directory
  3. From the console, run this command: export REPODIR=/path/to/your/local/repo/ && java org.sonatype.nexus.index.cli.NexusIndexerCli -r $REPODIR -i $REPODIR/.index -d $REPODIR/.index -n localrepo
  4. In the directory .index within the repository directory, some files will be created including the file "nexus-maven-repository-index.gz" which is the file IntelliJ looks out for.
like image 159
Björn Jacobs Avatar answered Oct 11 '22 08:10

Björn Jacobs