Gradle dependency for sqljdbc4-4.0.jar - gradle

I am not able to find gradle dependency for the same. it would be appreciated if any one provide the dependency for sqljdbc4-4.0.jar

I have found the dependency
com.microsoft.sqlserver:sqljdbc4:4.0

Related

Gradle dependency fallback

Is there a way to use fallback dependency in gradle.
For example, there is dependency com.example.module:artifact:version.
How can I "ask" gradle do not crash building if no this artifact found on any of specified repositories, but try to use com.example.fallback_module:vallback_artifact:fallback_version instead?

Issues with transitive dependency of a jar file - gradle

I am using gradle for dependency resolution but we rely on a library with cannot be resolved from a repo. As a workaround they asked us to use a workaround like :
implementation (files($network-file-path/lib.jar))
but this in turn is bringing a lot of transitive dependencies and causing a lot of trouble. I am very new to gradle and could not find a fix.
Is there a way through I can omit all the transitive dependencies of this specific jar ?
We are using gradle version 7.3.3

Maven Dependency Convergence Error on Direct Dependency

i've encountered a weird dependency convergency error while maven-enforcer-plugin is complaining about dependency convergency error on my direct dependency.
For example:
A -- B:1.0
|
-- C:1.0
|
-- B:1.1
A is my project and i specify B:1.0 as A's direct dependency in A's pom file. However, A also depends on C:1.0, which has a transitive dependency on B:1.1. Now maven is complaining about convergency error on B:1.0 and B:1.1.
In my understanding, once i specified a direct dependency in the master pom, we will stick to the version all the way for our project?
In this example, it should be B:1.0 that will be used by the project.
Am i understanding it incorrectly?
Thanks
To resolve convergence Errors, put the chosen dependency version into <dependencyManagement>.
A direct dependency will not resolve this kind of error.

Gradle refers jars but they are not in POM nor in the code links

We migrated our maven code to gradle. When we build, we are getting error as Could not resolve all files for configuration ':***-war:compileClasspath'.
Could not find mockito-core.jar (org.mockito:mockito-core:2.8.9).
We are not referring to this jar itself.. neither we are able to locate in our code nor in pom...
How to figure out?
how to configure gradle to compile code if jar doesn't exist and pom exists in the repository or locally ?
If you can't work out where it's coming from and you don't use it at all, then you can exclude the dependency from all the configurations:
configurations.all*.exclude group: "org.mockito", module: "mockito-core"
If the dependency isn't appearing in the dependency report, then I'm somewhat at a loss as to why Gradle is complaining about it. The only other option I can think of is that some plugin is adding it in a non-standard way.

How to find where a transitive dependency comes from in gradle?

Normally I would expect the dependencies task in Gradle to help me out, which it normally does. Now I have this issue when I print the dependency tree:
xml-apis:xml-apis:1.4.01 -> 2.0.2
xml-apis:xml-apis:1.3.04 -> 2.0.2
I have many of these lines where 1.3.04 and 1.4.01 get overriden, however, I have no line that explicitly shows a direct or transitive dependency to 2.0.2 version.
Where can 2.0.2 come from if there is no line with xml-apis:xml-apis:2.0.2 in the dependency tree?
How is that possible?
It's in there somewhere, try running gradle dependencyInsight --dependency xml-apis to find out.
This could be Gradle custom ResolutionStrategy working: https://docs.gradle.org/2.4/userguide/dependency_management.html#N15583, https://docs.gradle.org/2.4/dsl/org.gradle.api.artifacts.ResolutionStrategy.html. It can be instructed to use arbitrary version of any library, even if that version wouldn't otherwise be present anywhere in the dependency tree. It can also replace one library with another (log4j with log4j-over-slf4j, for example).

Resources