How do I install a POM in my local m2 repository?
Asked Answered
M

1

30

I need to install a parent POM (without a JAR file) into my local .m2 repository. mvn install:install-file won't let me do that, it always asks for a valid -Dfile=<path-to-jar>.

How can I install tmp/dependency-management-1.0.0-SNAPSHOT.pom?

Motor answered 19/5, 2014 at 14:5 Comment(0)
M
50

While you need to specify -Dfile, you can tell mvn install:install-file to ignore the file and just install the POM with -Dpackaging=pom:

mvn install:install-file \
    -Dpackaging=pom \
    -Dfile=tmp/dependency-management-1.0.0-SNAPSHOT.pom \
    -DpomFile=tmp/dependency-management-1.0.0-SNAPSHOT.pom

will just install the POM, ignoring the value passed as file.

Motor answered 19/5, 2014 at 14:7 Comment(1)
Note that file is not ignored! Whatever you specify as file will be copied to the .pom file in the local repository, e.g. if you specify a .jar file the .pom file will be binary identical to it. This is at least the case with maven-install-plugin:3.1.1.Fribble

© 2022 - 2024 — McMap. All rights reserved.