dependencies.txt includes an optional classifier before the version
field. This means if we pull in the same artifact with and without
classifier.
Change-Id: I3544bcc40aa0327ab7383266b2d8baf5d4f02af9
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit
11b40b2ce899b78ef8d6ba2b66acae0f6a4b4d02)
def dependencies = new File(project.build.directory,"dependencies.txt")
dependencies.eachLine {
def cmps = it.trim().split(":")
- // 0 - groupId
- // 1 - artifactId
- // 2 - Type
- // 3 - Version
- if(cmps.length >= 4) {
+ // Depends on number of components:
+ // - groupId
+ // - artifactId
+ // - Type
+ // - Qualifier (optional)
+ // - Version
+ // - Scope
+ if(cmps.length > 4) {
def id = cmps[0] + ":" + cmps[1]
- versionMap[id] = cmps[3]
+ if(cmps.length == 6) {
+ versionMap[id] = cmps[4]
+ } else if(cmps.length == 5) {
+ versionMap[id] = cmps[3]
+ }
}
}