Build file only to publish jars

Hello Ganesh,
I have tried something like this,
plugins {
id “com.jfrog.artifactory” version “4.0.0”
}

configurations{
allJars
}

I generate my bar files and add them to the configuration,
artifacts{
allJars destFile
}

My artifactory config looks like,
artifactory {
contextUrl = “${artifactory_host_url}/artifactory” //The base Artifactory URL if not overridden by the publisher/resolver
publish {
//A closure defining publishing information
repository {
repoKey = ‘libs-snapshot-local’ //The Artifactory repository key to publish to
username = “${artifactory_username}” //The publisher user name
password = “${artifactory_password}” //The publisher password
}
defaults {
publishConfigs(‘allJars’)
}
}
}

I call artifactoryPublish task to get all my generated artifacts up on artifactory. Hope this helps