这里仅对需要从
远程仓库
下载构件的解析机制做简要说明。
一、远程仓库定位
这里以maven中央仓库为例,在maven超级pom中,可以看到中央仓库的位置为:
http://repo.maven.apache.org/maven2
打开该网址,就进入到maven的仓库中,列出的目录即为group id
。
二、构件定位
这里以如下依赖配置为例:
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
在步骤一打开的页面中:
- 搜索
groupId
junit,点击进入该链接; - 打开链接后搜索
artifactId
junit,点击进入该链接; - 在该链接中可以看到各种版本号,搜索
version
4.8.2,进入该链接; - 在该页面中即可看到工程依赖的
junit-4.8.2.jar
包。