Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File 'xxxx/pom-default.xml' does not exist, and need to be published from publication xxx #92

Open
tonytvo opened this issue Aug 18, 2016 · 33 comments

Comments

@tonytvo
Copy link

tonytvo commented Aug 18, 2016

Hi guys, I wonder if any body experience this problem with the following environment settings:

gradle: 3.0
build-info-extractor-gradle: 4.4.2

I have seen the similar problem the jira ticket: https://www.jfrog.com/jira/browse/GAP-174
Any comments/suggestions works around would be much apreciated?

Cheers,
Tony

@eyalbe4
Copy link
Contributor

eyalbe4 commented Aug 18, 2016

Hi @tonytvo,
We're about to release version 4.4.3, which includes a few fixes aimed to better support all gradle project structures. Can you please try and run your build with the latest snapshot version of the plugin?
You can do that by adding the below snipper to your build script. Please let us know if it resolves the issue. In case it does not, can you please share with us a sample that replicates this issue?
Thanks,

buildscript {
  repositories {
    jcenter()
    maven {
      url "https://oss.jfrog.org/oss-snapshot-local"
    }
    dependencies {
      classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '4.4.x-SNAPSHOT')
    }
  }
}

@tonytvo
Copy link
Author

tonytvo commented Aug 18, 2016

I tried to use the snapshot version and the problem still persists with Gradle 3.0

it's a little bit more troublesome to create mock project that would simulate the exact behaviors, I will take a stab at it and see what I can do.

@eyalbe4
Copy link
Contributor

eyalbe4 commented Aug 18, 2016

Thanks @tonytvo.
Do you get the same issue with Gradle 2.x or it happens only with Gradle 3.0?

@tonytvo
Copy link
Author

tonytvo commented Aug 18, 2016

Couple more information for you:

Gradle 3.0 and build-info-extractor-gradle: 4.4.0 works for me, however, I saw the problem of the build not deploying artifacts to artifactory intermittently (I have created an issue for this)

Gradle 2.14.1 and build-info-extractor-gradle:4.4.2 has the same problem of pom-default.xml does not exist

@nucatus
Copy link

nucatus commented Sep 16, 2016

The same behavior with Artifactory plugin 4.4.4 / gradle 3.0

@eyalbe4
Copy link
Contributor

eyalbe4 commented Sep 16, 2016

@nucatus,
Any chance you can provide us with a sample project that reproduces this issue?

@nucatus
Copy link

nucatus commented Sep 16, 2016

After purging the ~/.gradle cache, the error is not occurring anymore.
I was reading the comments on the linked bug report https://www.jfrog.com/jira/browse/GAP-174 ... and this was one of resolutions.

@tonytvo
Copy link
Author

tonytvo commented Sep 20, 2016

I did blow away ~/.gradle cache and the problem still persists, I'm currently on gradle 3.1 and build-info-extractor-gradle 4.4.4

@tonytvo
Copy link
Author

tonytvo commented Sep 25, 2016

@eyalbe4 , I think I narrow down the problem a little bit.
For some reasons, upgrade build-info-extractor to 4.4.4 from 4.4.0, makes gradle skip all "generatePomFileFor*Publication", so I have to manually go through each build.gradle file in 53 subprojects and add the following line

afterEvaluate {
    artifactoryPublish.dependsOn 'generatePomFileForXXXPublication'
}

Here's the snapshot of one of my gradle file of one of the sub modules:

apply plugin: 'maven-publish'

task xxxZip() {
}

publishing {
    publications {
        'xxx-sample' (MavenPublication) {
        }
    }
}

artifactoryPublish {
    publications ( publishing.publications.'xxx-sample')
}

afterEvaluate {
    artifactoryPublish.dependsOn 'generatePomFileForXxx-samplePublication'
}

Let me know if you need anything else from me

@tonytvo
Copy link
Author

tonytvo commented Sep 25, 2016

@eyalbe4 , did I miss anything or do I have to add that afterEvaluate block? or do I have to wait for another cut 4.4.6 to get that addressed?

@tonytvo
Copy link
Author

tonytvo commented Oct 24, 2016

@eyalbe4 , I wonder if you have a chance to tackle this? or is it on the radar for the next release?

@eyalbe4
Copy link
Contributor

eyalbe4 commented Oct 24, 2016

@tonytvo, version 4.4.7 has been released about two weeks ago. The release includes the following fix:
When using the gradle daemon (which is on by default in gradle 3), the publication could be skipped, because the code included static variables. Stopping the daemon before running the build resolved the issue. Can you please try 4.4.7 and let us know if the issue is resolved?

@tonytvo
Copy link
Author

tonytvo commented Oct 24, 2016

@eyalbe4 , I cleared the ~/.gradle cache and the problem still persists... did I miss anything?

@eyalbe4
Copy link
Contributor

eyalbe4 commented Oct 24, 2016

@tonytvo, clearing the gradle cache is not relevant for this problem. Please try running grade --stop and then run the build. If the problem is resolved, use version 4.4.7, which includes the fix.

@tonytvo
Copy link
Author

tonytvo commented Oct 25, 2016

  • I ran gradle --stop
  • changed to version 4.4.7
  • run the build and the problem still persists....
  • @eyalbe4 is there anything else I'm missing here?

@eyalbe4
Copy link
Contributor

eyalbe4 commented Oct 25, 2016

@tonytvo,
Since the issue is not reproduced with any of the project examples, can you please share with us a sample project that shows this issue? We will use it to investigate and debug this.

@tonytvo
Copy link
Author

tonytvo commented Oct 25, 2016

@eyalbe4 , I will try to make the sample project and post it here.

@tonytvo
Copy link
Author

tonytvo commented Dec 13, 2016

@eyalbe4 , I'm sorry for the delay, I haven't been able to get to this, here's the sample version that doesn't work with 4.4.10 but work with 4.4.0
https://dl.dropboxusercontent.com/u/59660821/mock-gradle-artifactory-plugin.zip

'./gradlew buildAndPublishSample' would produce the problem with 4.4.10 but not with 4.4.0

my gradle version is 3.2.1
Let me know if you need anything else.

Again, I'm sorry for the delay

@tonytvo
Copy link
Author

tonytvo commented Dec 14, 2016

@eyalbe4 , @DimaNevelev , @romangurevitch Do I need to create a new issue since this issue might have been expired, thank you very much guys

@eyalbe4
Copy link
Contributor

eyalbe4 commented Dec 14, 2016

No need @tonytvo. Thanks for sharing the sample project.
I'm looking into this now.

@tonytvo
Copy link
Author

tonytvo commented Dec 14, 2016

thanks @eyalbe4 , let me know if you can reproduce the problem on your local machine with the sample projects.

@eyalbe4
Copy link
Contributor

eyalbe4 commented Dec 14, 2016

@tonytvo, I think I'm getting closer to the root cause of the issue.
Please let know if removing the org.gradle.configureondemand=true property from the gradle.properties file resolves the issue for you. In the meantime, we'll keep working on finding a solution for this issue.

@tonytvo
Copy link
Author

tonytvo commented Dec 14, 2016

thanks @eyalbe4 , it seems to work for us. Note that we would prefer to keep org.gradle.configureondemand as we have over 100 gradle modules so we would need keep the configureondemand to skip configuring not needed gradle module on building local dev environment.

Thank you very much for your promptly response. Much appreciated.

@jverne
Copy link

jverne commented Apr 21, 2017

Just a note for future spelunkers, this is still a problem for Gradle 3.5 and build-info-extractor-gradle:4.4.16.

I'm trying to bootstrap and publish a bunch of interrelated libraries using --configure-on-demand Back to editing as I go.

@tzutalin
Copy link

tzutalin commented Jun 29, 2017

I tried 4.4.18 and remove org.gradle.configureondemand from gradle.properties, and it can resolve the problem.

@PicoScott
Copy link

I remove org.gradle.configureondemand and resolve it with version 4.0.1

@pettermahlen
Copy link

Still happens with version 4.5.1 and Gradle 4.1-rc1. Removing 'configure on demand' is not an option for us, because full re-configuration takes way too long. My workaround is to add the following to each sub-module that needs to publish things to Artifactory.

afterEvaluate {
    artifactoryPublish.dependsOn 'generatePomFileForMavenJavaPublication'
    artifactoryPublish.dependsOn 'sourceJar'
    artifactoryPublish.dependsOn 'javadocJar'
}

@mstevens83
Copy link

I also experienced this problem when trying to publish an Android library to artifactory, using this as a starting point: https://github.com/JFrogDev/project-examples/blob/master/gradle-examples/4/gradle-android-aar/build.gradle

In order to make sure the pom file is (re)generated I have added this to the library module build.gradle file:

afterEvaluate {
    artifactoryPublish.dependsOn 'install' // Make sure pom file is (re)generated!
    artifactoryPublish.dependsOn 'sourceJar'
    artifactoryPublish.dependsOn 'javadocJar'
}

@AndrewReitz
Copy link

AndrewReitz commented Nov 7, 2017

Also able to reproduce this on https://github.com/groovy/groovy-android-gradle-plugin.
Removing configure on demand does not help.

@AndrewReitz
Copy link

For the groovy android plugin, updating to 4.5.0 causes the issue to appear, downgrading to 4.4.12 works as expected.

Gradle: 4.3
Java: 1.8

@PicoScott
Copy link

PicoScott commented Nov 20, 2017

I think we didn't generate pom file, try to run task generatePomFileForAarPublication before publish aar. It work in my case.If this work for you, you can add artifactoryPublish.dependsOn generatePomFileForAarPublication to your module.gradle, then you needn't run task generatePomFileForAarPublication next publish aar.

@rupebac
Copy link
Contributor

rupebac commented Jan 15, 2018

I am also meeting this problem. Disabling configure on demand, seems to fix it. Running generatePom task also fixes it. The strange thing is, that I am not sure who is creating generatePom<..> task, If I just refer to it in an indirect dependsOn, it cannot find it, even if I preceed it with a evaluationDependsOn(':bla'). On the other hand, if I preceed it with evaluationDependsOnChildren, it does work. Strange. I keep researching.

@rupebac
Copy link
Contributor

rupebac commented Jan 16, 2018

I think I have fixed this issue in this PR:

#147

The reason why I cannot depends on any generatePom task is because they are created using rules. I think after configuration phase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants