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

gradle plugin 4.4.1 breaks compatibility #87

Closed
ItamarBenjamin opened this issue Jul 11, 2016 · 23 comments
Closed

gradle plugin 4.4.1 breaks compatibility #87

ItamarBenjamin opened this issue Jul 11, 2016 · 23 comments

Comments

@ItamarBenjamin
Copy link

i got an exception from gradle while building:
Task with name 'artifactoryPublish' not found in project ':api'

@ForNeVeR
Copy link

For some reason my projects also were unable to build after updating 4.4.0 -> 4.4.1. Still investigating.

@eyalbe4
Copy link
Contributor

eyalbe4 commented Jul 11, 2016

@ItamarBenjamin,
Does the same project build properly with an older version of the plugin? If so, what is the older version?
Since the example projects (referenced from the plugin documentation) are working with 4.4.1, can you please provide us with a sample project that reproduces this issue?

@ItamarBenjamin
Copy link
Author

yes, when i explicltly reverted to 4.4.0 everything worked well as before. (previously i had imported the plugin with version 4.+)

i will try to reproduce this situation on a sample project, our gradle setup is quite complex to copy it here

@eyalbe4
Copy link
Contributor

eyalbe4 commented Jul 11, 2016

Thank you @ItamarBenjamin and @ForNeVeR.
We'll be waiting for s sample project that reproduces the issue.

@ItamarBenjamin
Copy link
Author

I have been able to reproduce this issue in a sample project

you can see the output here:
ibinyami@itstl087 /tmp/art_gradle >gradle build
[buildinfo] Not using buildInfo properties file for this build.
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar
:assemble
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test UP-TO-DATE
:check UP-TO-DATE
:build

BUILD SUCCESSFUL

Total time: 5.786 secs

This build could be faster, please consider using the Gradle Daemon: https://docs.gradle.org/2.14/userguide/gradle_daemon.html

ibinyami@itstl087 /tmp/art_gradle >vi build.gradle

********* here i change the plugin version to latest **********

ibinyami@itstl087 /tmp/art_gradle >gradle build
[buildinfo] Not using buildInfo properties file for this build.

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':api'.

    Task with name 'artifactoryPublish' not found in project ':api'.

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

BUILD FAILED

Total time: 5.591 secs
build.gradle.txt
settings.gradle.txt

@ForNeVeR
Copy link

ForNeVeR commented Jul 11, 2016

I have a similar setup, but in my case it silently fails telling that it cannot find the artifacts from my artifactory repo (and listing any sorts of URLs except my actual Artifactory repo).

I have a config like this:

artifactory {
    contextUrl = 'https://[REDACTED]/artifactory'
    resolve {
        repository {
            repoKey = '[REDACTED]'
            username = "${artifactory_user}"
            password = "${artifactory_password}"
            maven = true
        }
    }
}

I've compared the debug logs (obtained with ./gradlew -debug build) from 4.4.0 and 4.4.1 and I see the following difference. 4.4.0 have this line, while 4.4.1 haven't:

[org.jfrog.gradle.plugin.artifactory.extractor.listener.ProjectsEvaluatedBuildListener] Artifactory URL: https://[REDACTED]/artifactory/[REDACTED]

All the configuration files in my environment are the same.

I'll try to play with the sample projects to get the repro.

@eyalbe4
Copy link
Contributor

eyalbe4 commented Jul 11, 2016

Thanks @ItamarBenjamin and @ForNeVeR,
In order to pinpoint the root cause of these failures, it would really help if you could provide us with a sample project that we can run and reproduce a failure. Since all project examples (referenced from the plugin documentation) work properly, there's obviously something in your build scripts that the new version does not support. Any chance you can try and create such a sample?

@ItamarBenjamin
Copy link
Author

@eyalbe4 Hi Eyal, I've uploaded two gradle files with my last comment, they contain the sample for the output I posted before in that comment.

@ezraroi
Copy link

ezraroi commented Jul 11, 2016

@ItamarBenjamin lets create a public repo tomorrow in GitHub with the sample project.
@eyalbe4 , do you have any release notes or something similar for the new version?

@eyalbe4
Copy link
Contributor

eyalbe4 commented Jul 11, 2016

Sure @ezraroi,
The release notes for 4.4.1 are available here.
You can see the 2 commits for the 2 issues for this release. I suspect that one of them caused the issue you're experiencing. I'm sure that we'll be able to pinpoint the problem and fix it using a sample project.
All - thanks for the great cooperation!

@eyalbe4
Copy link
Contributor

eyalbe4 commented Jul 12, 2016

@ezraroi, @ItamarBenjamin and @ForNeVeR - please ignore my last comment, will rephrase and post again soon.

@ForNeVeR
Copy link

I think that my case is different. I'll try to make a repro sample and post another issue ASAP.

@ItamarBenjamin
Copy link
Author

Hi @eyalbe4
Indeed it may solve the issue, but what if the api subproject should not publish anything? if what you proposed is the solution then in that case applying the plugin to the root project forces us to apply it to all sub projects and in most cases the majority of them will not need to publish anything.

Seems like the issue is that the new version of the plugin for some reason depends on the existence of the artifactoryPublish task in all subprojects.

@eyalbe4
Copy link
Contributor

eyalbe4 commented Jul 12, 2016

Thanks for the feedback @ItamarBenjamin.
We created a snapshot version that resolves the issue your sample build script reproduces. GAP-260 tracks this fix.
Can please try out the snapshot version? You can install it as follows:

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

@ItamarBenjamin
Copy link
Author

Hi @eyalbe4
I can confirm this release fixes the issue. Thank you for the quick resultion. I have ran the our build scripts and they didn't fail on configuration phase. However, I wasn't able to publish to artifactory successfully as the build now fails with this error:

  • What went wrong:
    Execution failed for task ':client:artifactoryPublish'.

    File '/workarea/ibinyami/workspace/weed/java/client/build/publications/dist/pom-default.xml' does not exist, and need to be published from publication dist

@eyalbe4
Copy link
Contributor

eyalbe4 commented Jul 12, 2016

@ItamarBenjamin,
We'd like to better understand the structure of your gradle project, so that we can determine why it is not compatible with the recent changes. Can you please send an email to support@jfrog.com so that we can look into this together?

@eyalbe4
Copy link
Contributor

eyalbe4 commented Jul 18, 2016

@ItamarBenjamin, @ForNeVeR and @ezraroi,
I believe we have a fix for the issues discussed here, and we'd like to ask you try out the fix before publishing a new release. You can install the snapshot plugin as follows:

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

@ForNeVeR
Copy link

Wow, it really seems that my problem was fixed by the patch. Thank you, guys!

@regevbr
Copy link

regevbr commented Aug 7, 2016

@eyalbe4 , is it released? how can we install 4.4.2?

@eyalbe4
Copy link
Contributor

eyalbe4 commented Aug 7, 2016

@regevbr, 4.4.2 will soon be published.
We'll update here as soon as it is out there.

@eyalbe4
Copy link
Contributor

eyalbe4 commented Aug 8, 2016

@regevbr and all,
Version 4.4.2 is available on jcenter and should be soon available on plugins.gradle.org.

@eyalbe4
Copy link
Contributor

eyalbe4 commented Aug 22, 2016

Thanks everybody. Closing this issue.

@eyalbe4 eyalbe4 closed this as completed Aug 22, 2016
@regevbr
Copy link

regevbr commented Aug 22, 2016

Thanks!
@ItamarBenjamin

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

5 participants