Skip to content
Advertisement

Gradle : Failed to notify build listener

When we build our application using gradle, it is throwing the exception below .Following is the build.gradle code:

JavaScript

I am getting the below error : Build file, line: 81

Failed to notify build listener.

‘org.gradle.api.file.FileCollection org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal.getPublishableFiles()’

Can anyone help me please ?

Advertisement

Answer

For future readers who stumble upon this error.

I’ve been piece mealing together a working jfrog publish from here:

Gradle Artifactory Plugin – How to publish artifacts from multiple modules in a project?

I got the error, then realized I was not using android.

I got this error when I had this:

JavaScript

and changed “Android” to “mavenJava” as seen below.

JavaScript

My only other hint is that i have this. keep in mind i have a multi-module gradle project and i do not want to artifactory-publish the root module.

JavaScript

So my in general idea is : are you missing an apply-plugin ?

Documentation:

https://docs.gradle.org/current/userguide/publishing_maven.html#publishing_maven:complete_example

=========

Another Hint Project:

https://github.com/foragerr/SO-35851251-Multiproject-Artifactory-Publish

=========

Another longer answer I posted:

How do I generate maven-metata.xml with maven-publish and the artifactory-gradle-plugin?

=========

Just a reminder for newbies.

https://docs.gradle.org/current/dsl/org.gradle.api.publish.maven.MavenPublication.html

below is example code from url just above:

JavaScript

this is one reason why using “keywords” for the “myPublicationName” make it harder to discern.

=========

https://gradle.github.io/gradle-script-kotlin-docs/userguide/publishing_maven.html

publishing { publications { mavenJava(MavenPublication) { from(components.java) } } }

I’m still trying to figure out if mavenJava is just another name (like “myPublishingName” and the ‘from’ is the more important part. or it is a special name / reserved keyword.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement