Maven: add a dependency to a jar by relative path

后端 未结 9 1301
半阙折子戏
半阙折子戏 2020-11-21 23:21

I have a proprietary jar that I want to add to my pom as a dependency.

But I don\'t want to add it to a repository. The reason is that I want my usual maven commands

9条回答
  •  清歌不尽
    2020-11-22 00:07

    One small addition to the solution posted by Pascal

    When I followed this route, I got an error in maven while installing ojdbc jar.

    [INFO] --- maven-install-plugin:2.5.1:install-file (default-cli) @ validator ---
    [INFO] pom.xml not found in ojdbc14.jar
    

    After adding -DpomFile, the problem was resolved.

    $ mvn install:install-file -Dfile=./lib/ojdbc14.jar -DgroupId=ojdbc \
       -DartifactId=ojdbc -Dversion=14 -Dpackaging=jar -DlocalRepositoryPath=./repo \
       -DpomFile=~/.m2/repository/ojdbc/ojdbc/14/ojdbc-14.pom
    

提交回复
热议问题