Jenkins Jfrog Artifactory Plugin Caused by: org.gradle.api.InvalidUserCodeException: Could not apply withXml() to generated POM

Jenkins Jfrog Artifactory Plugin version 4.0.0 based artifactoryPublish task throwing this error. previous version 3,x was working.

4.0.0 version, it looks like

23:46:17  > Task :build
23:46:17  
23:46:17  FAILURE: Build failed with an exception.
23:46:17  
23:46:17  * What went wrong:
23:46:17  Execution failed for task ':generatePomFileForMavenWebPublication'.
23:46:17  > Could not apply withXml() to generated POM
23:46:17     > java.lang.NullPointerException (no error message)
23:46:17  
23:46:17  * Try:
23:46:17  > Run with --info or --debug option to get more log output.
23:46:17  > Run with --scan to get full insights.
23:46:17  
23:46:17  * Exception is:
23:46:17  org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':generatePomFileForMavenWebPublication'.
artifacts {
    archives bootWar
}


artifactory {
    publish {
        defaults {
            publications('mavenJava')
	    publishArtifacts = true
        }
    }
  }

 
publishing {
    publications {
        mavenWar(MavenPublication) { 
            artifact bootWar
        }
    }
}
 
pluginManager.withPlugin('com.jfrog.artifactory') { 
    artifactoryPublish {
       publications('publishing.publications.mavenWar')
    }
}
23:46:17  	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
23:46:17  	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:49)
23:46:17  Caused by: org.gradle.api.UncheckedIOException: Could not write to file /build/publications/mavenWeb/pom-default.xml'.
23:46:17  	at org.gradle.internal.IoActions$TextFileWriterIoAction.execute(IoActions.java:152)

When I try to add this

pluginManager.withPlugin('com.jfrog.artifactory') {
 artifactory {
    publish {
        defaults {
            publishConfigs('archives', 'published')
        }
    }
}
}
08:18:00  Build file '//build.gradle' line: 261
08:18:00  
08:18:00  * What went wrong:
08:18:00  No signature of method: org.jfrog.gradle.plugin.artifactory.task.ArtifactoryTask.publishConfigs() is applicable for argument types: (String, String) values: [archives, published]
08:18:00  > Could not find method publishConfigs() for arguments [archives, published] on task ':artifactoryPublish' of type org.jfrog.gradle.plugin.artifactory.task.ArtifactoryTask.
08:18:00  
08:18:00  * Try:
08:18:00  > Run with --stacktrace option to get the stack trace.
08:18:00  > Run with --debug option to get more log output.
08:18:00  > Run with --scan to get full insights.
08:18:00  
08:18:00  * Get more help at https://help.gradle.org
08:18:00  
08:18:00  BUILD FAILED in 6s

You should probably ask the maintainers of that plugin how to use it, or its documentation.
This forum is more for Gradle questions, not for help with each and every plugin out there.
Maybe someone know and answers here and answers, just in case if not.

Also, I can greatly recommend switching to Kotlin DSL for your build scripts. 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 if you use a good IDE like IntelliJ IDEA or Android Studio.

So, you are suggesting contacting jfrog gradle plugin contributors. Thanks. Let me do that…