I hava a question about Maven pom.xml.
I add a dependency in pom.xml like:
<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>
I can not understand the usage of < classifier > and < type >.
My questions are:
- What is the meaning of classifier and type
- What is the meaning of scope(runtime) while the type is xml. I guess xml means maven needs a xml file, but what is it to do with runtime? I think runtime is always associated with "added to classpath", but why xml?
If I comment on < type > I got error like:
[ERROR] Failed to execute goal on project test: Could not resolve dependencies for project com.ruan:test:jar:1.0-SNAPSHOT: Failure to find org.opendaylight.controller:features-restconf:jar:features:1.2.1-Lithium-SR1 in http://nexus.opendaylight.org/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of opendaylight-mirror has elapsed or updates are forced -> [Help 1]
If I comment on < classifier > I got error like:
[ERROR] Failed to execute goal on project test: Could not resolve dependencies for project com.ruan:test:jar:1.0-SNAPSHOT: Failure to find org.opendaylight.controller:features-restconf:xml:1.2.1-Lithium-SR1 in http://nexus.opendaylight.org/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of opendaylight-mirror has elapsed or updates are forced -> [Help 1]
If I run it correctly, I got the directory like:
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