Title: Message Title
Vlastimil Dolejš commented on JENKINS-52669
Re: IndexOutOfBoundsException after upgrade to 1.2.3
I can confirm that the problem is related to the version range. In my case, I don't have direct dependency with version range but there is some transitive dependency in my dependency tree that has version declared as a range. I have cloned the plugin source and written unit test for my artifact so I know the details. The problematic dependency in my case is org.webjars.npm:js-tokens:jar:[1.0.1,2) This dependency can be resolved and there are these versions in repository: [1.0.0, 1.0.1, 2.0.0, 3.0.0, 3.0.1, 3.0.2, 4.0.0]. The problematic part of code is in
ReleasedVersionRangeResolver#resolveVersionRange
on lines 134 and 135. The 3.0.2 and 4.0.0 is picked as the
versionsAndUpToDates.latestCandidates
and
versionsAndUpToDates.releaseCandidates
which is then passed to
getLatest()
but none of these versions satisfy version range constraint which is [1.0.1,2). So I think there are 2 problems. 1/ The getLatest() method should return null instead of throwing exception if it won't match any version with the version range. 2/ I think we should pass versionsAndUpToDates.versions instead of versionsAndUpToDates.latestCandidates and releaseCandidates to the getLatest() method on lines 134 and 135. I have created pull request for the first problem: https://github.com/jenkinsci/repository-connector-plugin/pull/37 This will completely resolve the problem because resolving transitive dependencies is not necessary.
Add Comment