首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在maven中指定本地jars的路径

问如何在maven中指定本地jars的路径
EN

Stack Overflow用户
提问于 2011-11-18 21:58:13
回答 1查看 479关注 0票数 4

我正在使用maven2来构建java项目。当我尝试使用mvn install构建时,我得到了编译错误,说一些包xya.abc.aaa不存在。这个包可以在本地磁盘上我自己的jar中找到。这个jar(比方说test.jar)是我创建的。

我怎样才能告诉maven使用这个本地jar来获取它在本地磁盘上查找的包呢?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-11-18 21:59:00

你需要使用install the dependencies to your local repository。

代码语言:javascript
复制
mvn install:install-file
  -Dfile=<path-to-file>
  -DgroupId=<group-id>
  -DartifactId=<artifact-id>
  -Dversion=<version>
  -Dpackaging=<packaging>
  -DgeneratePom=true

Where: <path-to-file>  the path to the file to load
       <group-id>      the group that the file should be registered under
       <artifact-id>   the artifact name for the file
       <version>       the version of the file
       <packaging>     the packaging of the file e.g. jar
票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8183561

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档