1

I recently cloned a Gradle projcet (from GitHub) that its scripts is in Kotlin DSL (that I'm not comfortable with it). I could convert all of its scripts to Groovy except below snippet:

publishing {
​    publications {
​        register("mavenJava", MavenPublication::class) {
​            artifactId = base.archivesBaseName
​            from(components["java"])
​        }
​    }
}

What is its equivalent in Groovy?

ali.etemadi77
  • 79
  • 1
  • 4

1 Answers1

1
publishing {
    publications {
        register("mavenJava", MavenPublication) {
            artifactId = archivesBaseName
            from components.java
        }
    }
}

Refer to this link for more information:

https://guides.gradle.org/migrating-build-logic-from-groovy-to-kotlin/

Mir-Ismaili
  • 13,974
  • 8
  • 82
  • 100