Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 585
agrosner Avatar asked Sep 04 '14 14:09

agrosner


3 Answers

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!

like image 50
Vivek Soneja Avatar answered Oct 21 '22 04:10

Vivek Soneja


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).

like image 2
JBaruch Avatar answered Oct 21 '22 04:10

JBaruch


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
}
like image 2
Moth Avatar answered Oct 21 '22 05:10

Moth