I have a publishing task like this: ```publishing...
# community-support
s
I have a publishing task like this:
Copy code
publishing {
    publications {
        rootBOM(MavenPublication) {
            from components.javaPlatform
            artifactId = 'my-framework-root-bom'
        }
    }
Intellij IDEA shows warning saying:
'rootBOM' cannot be applied to '(java.lang.Class<org.gradle.api.publish.maven.MavenPublication>, groovy.lang.Closure<java.lang.String>)'
its working.. but intellij shows warning.. im not sure why ? I want to use custom name instead of default name like mavenJava etc.. but everywhere i see examples like that only for custom publishing task names..
When i asked copilot, its suggesting to use like this:
Copy code
publications {
    create('rootBOM', MavenPublication) {
        from components.javaPlatform
        artifactId = 'my-framework-root-bom'
    }
}
s
your code looks fine (in Groovy), I think it’s just IDEA getting confused.
👍 1
v
I strongly recommend switching to Kotlin DSL. By now it is the default DSL, you immediately get type-safe build scripts, actually helpful error messages if you mess up the syntax, and amazingly better IDE support when using a good IDE like IntelliJ IDEA or Android Studio. But besides that I agree with Sergej, probably just the IDE being confused. If you re-sync the project it should hopefully go away, or if not try "Invalidate Caches and Restart" which is always a good idea when IntelliJ behaves largely unexpected.
👍 1
s
I would love to switch to Kotlin DSL.. but in my case, entire organization uses Groovy DSL for their modules and its a central team decision from quite a long time.. 🙂
v
Never too late to revise a bad decision 🙂