【发布时间】:2016-01-29 03:59:40
【问题描述】:
我有一个关于 Maven pom.xml 的问题。
我在 pom.xml 中添加了一个 依赖,例如:
<dependencies>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>features-restconf</artifactId>
<version>1.2.1-Lithium-SR1</version>
<classifier>features</classifier>
<type>xml</type>
<scope>runtime</scope>
</dependency>
</dependencies>
我的问题是:
- classifier和type是什么意思
- 范围(运行时)是什么意思,而类型是xml。我猜 xml 意味着 maven 需要一个 xml 文件,但它与它有什么关系 运行时?我认为 runtime 总是与“添加到类路径”相关联,但为什么是 xml?
如果我对 发表评论,我会收到如下错误:
[ERROR] 未能在项目测试中执行目标:无法解决 项目 com.ruan:test:jar:1.0-SNAPSHOT 的依赖项:失败 找 org.opendaylight.controller:features-restconf:jar:features:1.2.1-Lithium-SR1 在http://nexus.opendaylight.org/content/repositories/public/ 是 缓存在本地仓库中,不会重新尝试解析 直到 opendaylight-mirror 的更新间隔已过或 强制更新 -> [帮助 1]
如果我对
[ERROR] 未能在项目测试中执行目标:无法解决 项目 com.ruan:test:jar:1.0-SNAPSHOT 的依赖项:失败 找 org.opendaylight.controller:features-restconf:xml:1.2.1-Lithium-SR1 在 http://nexus.opendaylight.org/content/repositories/public/ 已缓存 在本地存储库中,将不会重新尝试解析,直到 opendaylight-mirror 的更新间隔已过或更新是 强制 -> [帮助 1]
如果我运行正确,我会得到如下目录:
haoruan:~/.m2/repository/org/opendaylight/controller/features-restconf $ cd 1.2.1-Lithium-SR1/
total 96
-rw-r--r-- 1 haoruan staff 264B Oct 29 13:58 _remote.repositories
-rw-r--r-- 1 haoruan staff 397B Oct 29 13:38 features-restconf-1.2.1-Lithium-SR1-features.jar.lastUpdated
-rw-r--r-- 1 haoruan staff 9.0K Oct 29 13:58 features-restconf-1.2.1-Lithium-SR1-features.xml
-rw-r--r-- 1 haoruan staff 40B Oct 29 13:58 features-restconf-1.2.1-Lithium-SR1-features.xml.sha1
-rw-r--r-- 1 haoruan staff 12K Oct 29 13:38 features-restconf-1.2.1-Lithium-SR1.pom
-rw-r--r-- 1 haoruan staff 40B Oct 29 13:38 features-restconf-1.2.1-Lithium-SR1.pom.sha1
-rw-r--r-- 1 haoruan staff 397B Oct 29 13:39 features-restconf-1.2.1-Lithium-SR1.xml.lastUpdated
【问题讨论】:
标签: java maven-3 opendaylight