YaoRaoLov 2011-02-10 10:03 采纳率: 50%
浏览 2419
已采纳

如何将本地 jar 文件添加到 Maven 项目中?

How do I add local jar files (not yet part of the Maven repository) directly in my project's library sources?

转载于:https://stackoverflow.com/questions/4955635/how-to-add-local-jar-files-to-a-maven-project

  • 写回答

26条回答 默认 最新

  • 乱世@小熊 2011-02-10 10:08
    关注

    Install the JAR into your local Maven repository as follows:

    mvn install:install-file \
       -Dfile=<path-to-file> \
       -DgroupId=<group-id> \
       -DartifactId=<artifact-id> \
       -Dversion=<version> \
       -Dpackaging=<packaging> \
       -DgeneratePom=true
    

    Where each refers to:

    < path-to-file >: the path to the file to load e.g -> c:\kaptcha-2.3.jar

    < group-id >: the group that the file should be registered under e.g -> com.google.code

    < artifact-id >: the artifact name for the file e.g -> kaptcha

    < version >: the version of the file e.g -> 2.3

    < packaging >: the packaging of the file e.g. -> jar

    Reference

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(25条)

报告相同问题?

悬赏问题

  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题