if (project.hasProperty('artifactoryUser')) {
    artifactory {
        publish {
            contextUrl = project.property('artifactoryUrl')
            repository {
                repoKey = project.property('artifactoryRepoKey')
                username = project.property('artifactoryUser')
                password = project.property('artifactoryPassword')
            }
            defaults {
                publications("${project.name}")
                publishBuildInfo = false
                publishArtifacts = true
                publishPom = true
            }
        }
    }
}

if (project.hasProperty("signing.keyId")) {
        pluginManager.withPlugin('maven-publish') {
            apply plugin: 'signing'
            signing {
                sign publishing.publications."${project.name}"
            }
        }
}
