perhaps? 2011-02-10 10:03 采纳率: 100%
浏览 947
已采纳

如何将本地 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

  • 写回答

27条回答 默认 最新

  • from.. 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

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

报告相同问题?

悬赏问题

  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用