Andrew Grosner
Andrew Grosner

Reputation: 2387

Gradle Artifactory Plugin Not Generating Pom File

A weird issue is occurring when I try to "artifactoryPublish" to a remote artifactory repository.

I have the task run

./gradlew clean jar artifactoryPublish

Which worked only a couple days ago. Now I am getting this error:

:artifactoryPublish FAILED

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':artifactoryPublish'.
> File '/Users/me/Programming/android/LibraryPlugin/build/poms/pom-default.xml'      specified for property 'mavenDescriptor' does not exist.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more      log output.

What am I doing wrong?

Upvotes: 10

Views: 8080

Answers (6)

radrocket81
radrocket81

Reputation: 329

Had the same issue. I solved it by simply running the task:

./gradlew generatePomFileForWarPublishPublication

Provided by the artifactory plugin.

Upvotes: 0

sver
sver

Reputation: 942

I am using a custom plugin in my AS project. I changed the version of gradle in custom plugin to the same version I am using in AS. Then,I executed the command via terminal rather than running from AS. Worked for me

Upvotes: 0

DroidBoy
DroidBoy

Reputation: 162

This problem can simply be solved by publishing through command line instead of through Android Studio ./gradlew clean module_name:artifactoryPublish [Link] https://github.com/dcendents/android-maven-gradle-plugin/issues/17

Upvotes: -2

Moth
Moth

Reputation: 775

We had this same issue after upgrading our Gradle version but found it was an issue with using old settings for the com.github.dcendents.android-maven plugin. To resolve the issue we removed the configure block and instead created a task to create the pom-defaults.xml file. Here's the relevant parts of our gradle file:

task writeNewPom {
    pom {
        project {
            packaging 'aar'
            name 'Some Name'
            url 'http://www.example.com'
            licenses {
                license {
                    name 'The Apache Software License, Version 2.0'
                    url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
                    distribution 'repo'
                }
            }
        }
    }.writeTo("$buildDir/poms/pom-default.xml")
}

artifactoryPublish {
    dependsOn assembleRelease
    dependsOn sourcesJar
    dependsOn writeNewPom
}

Upvotes: 2

Vivek Soneja
Vivek Soneja

Reputation: 880

I was facing the similar issue, I had optimised the gradle.properties for fast compiling.

org.gradle.daemon=true
org.gradle.jvmargs=-Xmx3072m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true
org.gradle.configureondemand=true

Removing them once and compiling the code worked, you can add them back once the pom is generated.

Most probably "parallel=true" was the culprit.

Hope it helps!

Upvotes: 20

JBaruch
JBaruch

Reputation: 22923

Gradle build snippet in the question could be useful, but if I have to blindly guess, I bet that you don't have maven or maven-publish plugin applied (or you applied the wrong one).

Upvotes: 2

Related Questions