所以我有一个项目,我定期发布到 Maven 没有问题。我现在想要提供该项目的快照版本。所以我做了“mvn clean 部署”。一切正常,如下所示:
[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 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)
I go to my sonatype manager and I can find the snapshot:
但现在当我尝试使用此快照作为对其他项目的依赖时在另一台机器上 I get:
<dependency>
<groupId>me.soliveirajr</groupId>
<artifactId>menta-regex</artifactId>
<version>0.9.6-SNAPSHOT</version>
</dependency>
Missing:
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 部署:部署文件 -DgroupId=me.soliveirajr -DartifactId=menta-regex -Dversion=0.9.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id ]
那么如何强制 maven 将 SNAPSHOT 版本下载到我的本地(.m2)存储库?