I need a local repository for my project for a JAR file not available via the Maven Central repository. I install my JAR using mvn install:install-file …
as per http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html, using -DlocalRepositoryPath
to indicate the path in my Git repository, and using -DcreateChecksum
to create checksums.
This installs the JAR, generates a POM, and generates checksums for all the files. But interestingly it also creates a maven-metadata-local.xml
file in the groupId directory. From http://maven.apache.org/ref/3.2.5/maven-repository-metadata/ I gather that local
is the ID it is giving the local repository.
But in my POM (mvn install:install-file
had no way of knowing) I use the ID local-repo
for my repository:
<repositories>
<repository>
<id>local-repo</id>
<url>file:///${project.basedir}/repo</url>
</repository>
</repositories>
Of course I could change my POM to use simply <id>local</id>
to match the generated files, but I don't like to do things without understanding why I'm doing it. So maybe someone could tell me:
- Do I need the
maven-metadata-local.xml
? Does it serve a purpose? - Does the
local
part need to match the repository ID I use in the POM? - Does
mvn install:install-file
have a parameter to allow me to indicate the ID to use for the local repository (e.g. to generatemaven-metadata-local-repo.xml
, or must I manually rename the file afterwards?