10

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?

1
  • 1
    Might as well run with the --stacktrace option to get more information. Commented Sep 4, 2014 at 14:27

6 Answers 6

20

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!

2
  • 11
    Holy moly this was helpful! For me I needed to disable configureondemand. Commented Apr 25, 2016 at 20:39
  • Great, thanks a lot. Adding org.gradle.configureondemand=true helped me.
    – gjigandi
    Commented Mar 4, 2018 at 11:07
2

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

4
  • I have same issue using android-maven like in the gradle-android-aar example. I submitted an issue to the plugin repo > github.com/dcendents/android-maven-plugin/issues/17.
    – jdONeill
    Commented Mar 29, 2015 at 0:57
  • @JBaruch, I am also getting a similar error but I do have maven and maven-publish plugin applied.
    – Jason
    Commented Aug 26, 2015 at 22:39
  • @Jason that deserves a separate question with your build script in it.
    – JBaruch
    Commented Aug 26, 2015 at 23:26
  • @JBaruch: This error seems to be an issue with gradle 2.4 and above. jfrog.com/jira/browse/GAP-174
    – Jason
    Commented Aug 27, 2015 at 0:03
2

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
}
1
  • 2
    For this to be working, you need to wrap the whole pom block inside a doLast{} block.
    – fast3r
    Commented Dec 12, 2016 at 13:46
0

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

0

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

./gradlew generatePomFileForWarPublishPublication

Provided by the artifactory plugin.

-2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.