BUG-3837: fix classifier incorrectly used as version 94/23194/1
authorRobert Varga <rovarga@cisco.com>
Tue, 23 Jun 2015 09:10:01 +0000 (09:10 +0000)
committerRobert Varga <nite@hq.sk>
Tue, 23 Jun 2015 18:54:24 +0000 (18:54 +0000)
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)

features-parent/pom.xml

index f45a5c7821d9562a228f0787519d2abdbf52af81..5b359524cf527575342af82723cd85959a095a5f 100644 (file)
                                     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]
+                                            }
                                         }
                                     }