How to index Maven repository without Nexus / Artifactory / etc?

I am running my little Maven repository for some open source. I do not have a dedicated server, so I use the Google code repository , deploy the file system, and then commit and click. Great for me.

But some Maven tools look for nexus-maven-repository-index.properties and index (in GZ). I would like to create this index for

  • get rid of the warning that it is not here
  • Maven is not trying to repo for artifacts that aren't there.

How can i do this? Is there a tool (Java main) capable of generating an index? Also, tips on how to use proper Nexus Jars with a small command line tool are welcome.

+6
repository maven nexus maven-indexer
source share
3 answers

You can use the CLI Maven Indexer to directly represent the index, but why bother with your own repo when OSS projects can use hosting for free?

http://nexus.sonatype.org/oss-repository-hosting.html

+3
source share

I came across this post when I was looking for a solution to add a local repository to a Maven project using IntelliJ Idea.

Since Sonatype has changed its paths and reorganized the download since the last post, here is an updated step-by-step tutorial to index your repository for use with IntelliJ Idea:

  • Download the latest standalone indexer from here .
  • Take it out somewhere and go to this directory
  • On the console, run the following 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
  • Some files will be created in the .index directory in the repository directory, including the file "nexus-maven-repository-index.gz", which is the IntelliJ file that it is looking for.
+10
source share

I looked at the maven indexer ... but I'm not sure what the last indexDir parameter in a method is:

  public RepositoryIndexer createRepositoryIndexer(String repositoryId, File repositoryBasedir, File indexDir) 

is it like a starting point in a basir repository?

0
source share

All Articles