Maven: add a dependency to a jar by relative path

后端 未结 9 1042
半阙折子戏
半阙折子戏 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条回答
  •  旧时难觅i
    2020-11-22 00:06

    Using the system scope. ${basedir} is the directory of your pom.

    
        ..
        ..
        system
        ${basedir}/lib/dependency.jar
    
    

    However it is advisable that you install your jar in the repository, and not commit it to the SCM - after all that's what maven tries to eliminate.

提交回复
热议问题