Gradle upgrade from 3.5 to 5.5 | Downloading two versions


We have upgraded from 3.5 version to 5.5.1 gradle version. After upgrading the build is downloading 2 versions of the jars (Both base and lastest versions), whereas it should be downloading the latest version only.

Please can someone help as to why it is downloading 2 versions and how can we resolve this issue.

You need to provide more information.
2 versions of which jars?
Can you provide an MCVE?
Or maybe a build --scan?

Two versions of the custom jars of the project.

So we have this base jar versioned 5.0.0 and then we keep creating new versions of this jar every release (current version is 5.1.20) , till 3.5 gradle version during build it was downloading the latest version only but after upgrading to 5.5.1 it is downloading both 5.0.0 and 5.1.20 version of the custom jar, due to which our build fails as the classes which are present in 5.1.20 are not present in 5.0.0 version, not sure what has changed in 5.5.1 version of gradle.

I even checked dependency of the jar by running the below command.

./gradlew :cou_core:dependencyInsight --configuration compile --dependency platform-resources-shared

Below sharing one line of the output (All other lines are similar)[05.01.00-SNAPSHOT,05.01.20-SNAPSHOT] → 05.01.20-SNAPSHOT (*)

The output gives expected return.

Maybe you refer to different versions in different projects or different between test and production or whatever.
It is really impossible to tell without seeing your build, an MCVE, or at least a build --scan.

You could also use the dependencies task once on each project in the build and then search there where the old version is referenced.