【发布时间】:2011-12-04 15:29:05
【问题描述】:
所以我有一个项目,我定期发布到 maven 没有问题。我现在想提供这个项目的 SNAPSHOT 版本。所以我做'mvn clean deploy'。一切正常,如下所示:
[INFO] 从 sonatype-nexus-snapshots 检索以前的内部版本号 上传:https://oss.sonatype.org/content/repositories/snapshots/me/soliveirajr/menta-regex/0.9.6-SNAPSHOT/menta-regex-0.9.6-20111010.153035-2.jar 5K 上传 (menta-regex-0.9.6-20111010.153035-2.jar)
我去我的 sonatype 管理器,我可以找到快照:
但是现在,当我尝试将此快照用作对其他项目的依赖项时在另一台机器上我得到:
<dependency>
<groupId>me.soliveirajr</groupId>
<artifactId>menta-regex</artifactId>
<version>0.9.6-SNAPSHOT</version>
</dependency>
缺失:
1) me.soliveirajr:menta-regex:jar:0.9.6-SNAPSHOT
尝试从项目网站手动下载文件。
然后,使用以下命令安装它: mvn install:install-file -DgroupId=me.soliveirajr -DartifactId=menta-regex -Dversion=0.9.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
或者,如果您托管自己的存储库,则可以在那里部署文件: mvn deploy:deploy-file -DgroupId=me.soliveirajr -DartifactId=menta-regex -Dversion=0.9.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id ]
那么如何强制 maven 将 SNAPSHOT 版本下载到我的本地 (.m2) 存储库?
【问题讨论】:
标签: java maven-2 maven snapshot