Publishing artifacts to Jfrog

I have created a Kotlin library and I’m trying to publish artifacts to Jfrog by referring to this article : Gradle Artifactory Plugin - JFrog - JFrog Documentation . In my build.gradle.kts artifactoryPublish is not working. It works with build.gradle file. I need some help here on the gradle configuration needed to publish a kotlin library to Jfrog