Maven,如何添加回购中不可用的其他库 [英] Maven, how to add additional libs not available in repo

查看:117
本文介绍了Maven,如何添加回购中不可用的其他库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Maven项目,该项目具有一组库依赖关系,而这些依赖关系无法通过任何Maven存储库获得.如何将这些库添加到pom?我想这样做,所以当我运行'mvn eclipse:eclipse'时,它不会从eclipse类路径中删除那些库.

I have a maven project that has a set of library dependancies that are not available via any maven repository. How can I add those libraries to the pom? I want to do this so when I run 'mvn eclipse:eclipse' it doesnt remove those libraries from the eclipse classpath.

推荐答案

您有3个选项:

  • 通过install:install-file将库添加到本地存储库中(显然,这不是可移植的,如果不这样做,您将无法在另一台计算机上构建项目).
  • 安装并运行Nexus,Archiva或Artifactory等企业存储库",然后通过deploy:deploy-file添加您的库.
  • 按照此
  • Add your libraries to your local repository via install:install-file (obviously, this is not portable, you won't be able to build the project on another machine without doing the same).
  • Install and run an "enterprise repository" like Nexus, Archiva, or Artifactory and add your libraries via deploy:deploy-file.
  • Setup a file based repository as described in this previous answer and put your libraries in there.

然后,像其他任何依赖项一样,在pom中声明您的库.

Then, declare your libraries in your pom like any other dependency.

这篇关于Maven,如何添加回购中不可用的其他库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆