Gradle with jenkins pipeline


I have noticed that when I build in jenkins pipeline it using these below:

def server = Artifactory.server ‘ArcaJFrogArtifactory’
def rtGradle = Artifactory.newGradleBuild()
rtGradle.deployer repo: ‘libs-snapshot-local’, server: server
rtGradle.resolver repo: ‘libs-snapshot’, server: server

It does not use the artifactory in the resolver, instead it uses the repository in the build file.
Does anyone know why this is happening?