Hi,
When I declare a dependency in a version that does not exist and this version is not selected during the version resolution because of another higher version in the dependency tree, the resolution does not fail.
For example I have 2 libraries in my repository: lib1 with versions 1.0.0 and 1.1.0, and lib2 with version 1.0.0 which depends on lib1:1.0.0. In my project I declare the 2 dependencies lib1:x1.1.0 (the “x” is on purpose, my point is about mistakes in dependencies declaration) and lib2:1.0.0. So I get this dependency tree:
- lib1:x1.1.0
- lib2:1.0.0
- lib1:1.0.0
Gradle resolves this with no error by selecting lib1:1.0.0 and lib2:1.0.0. If I understand correctly, this is normal according to the resolution strategy, and Gradle first selects the versions before trying to fetch them. But I am wondering if I can force Gradle to fail if a version does not exist. This case can happen when a user did a mistake in the dependency version (“x1.0.0” instead of “1.0.0”), the build does not fail even if the version does not exist so the user may not see the mistake easily.
Is there an option or a way to force the failure in this case?
Regards.