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

牧云@^-^@ 提交于 2019-12-03 07:25:08

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

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

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.

I was looking at maven indexer... but I am not sure what for is the last parameter indexDir in the method:

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

is it like starting point in the repositoryBasedir?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!