maven - lein 尝试下载工件,即使它存在于本地
问题描述
lein run
导致以下错误:
Could not find artifact foo:common:jar:10.11.0 in central (https://repo1.maven.org/maven2/)
Could not find artifact foo:common:jar:10.11.0 in clojars (https://clojars.org/repo/)
但是,在我的计算机上,该文件~/.m2/repository/foo/common/10.11.0/common-10.11.0.jar
存在。似乎 lein 正在尝试从 central 和 clojars 下载该文件,即使它已经存在于我的计算机上。
这个特定的 jar 不存在于 maven central 或 clojars 中,它存在于一个私有存储库中,我只有在某个网络上时才能访问它。我现在不在那个网络上,所以如果lein
不尝试下载我的计算机上已经存在的文件,它会非常有帮助。
有谁知道如何解决这一问题?
更新
我得到了你可以lein
在离线模式下运行的信息lein -o ...
。这导致了以下错误:
The repository system is offline but the artifact foo:common:jar:10.11.0 is not available in the local repository.
解决方案
以上听起来不错。另请参阅以下内容,您可能希望绕过整个 maven jar 机制并将 jar 放入./resources
(至少暂时):
仔细注意资源字符串的所需格式!
(defproject test-project "0.1.0-SNAPSHOT"
:description "Blah blah blah"
...
:resource-paths ["resources/Siebel.jar" "resources/SiebelJI_enu.jar"])
另请参阅该链接中另一个答案中进行本地 maven 安装的选项:
mvn deploy:deploy-file -Dfile=jaad-0.8.3.jar -DartifactId=jaad -Dversion=0.8.3 -DgroupId=jaad -Dpackaging=jar -Durl=file:maven_repository
推荐阅读
- spring-mvc - Spring Boot Rest API - 无法上传文件
- list - prolog 中的列表不会用逗号打印
- powershell - 如何从 PowerShell 返回 PSObject[] 并从该 PSObject 获取值
- jenkins - Jenkins 用户缺少整体/读取权限 - 项目角色
- ios - 获取设置导航左按钮 swift
- excel - ISNUMBER 检测唯一到期日期以突出显示单元格
- java - 在下面的代码中,不是两个对象引用都是 StringBuilder 类型的吗?
- sip - 在 Sip.js javascript 框架中启用 traceSip 选项时出现问题
- python - 在 Jenkins 结果上发布 python 脚本 Nosetest 输出
- php - 正则表达式 PHP 查找并匹配具有特定数据属性的 HTML 标记