Codearte/gradle-nexus-staging-plugin

Cannot apply plugin from another .gradle file

burdoto opened this issue · 4 comments

This is my buildscript:

buildscript {
    repositories {
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }
    dependencies {
        classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.20.0"
    }
}

apply plugin: "io.codearte.nexus-staging"

It is copied 1:1 from the Gradle page, yet I get the following error:

FAILURE: Build failed with an exception.

* Where:
Script '...\gradle\publishing.gradle' line: 14

* What went wrong:
A problem occurred evaluating script.
> Plugin with id 'io.codearte.nexus-staging' not found.

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

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.2/userguide/command_line_interface.html#sec:command_line_warnings

CONFIGURE FAILED in 0s
Plugin with id 'io.codearte.nexus-staging' not found.

and i am out of ideas

szpak commented

Do you have the buildscript {} in your build.gradle or in publishing.gradle? If the later, try to move it (just that block) to the main build.gradle. AFAIR, there is an open issue with the buildscript dependencies defined in other files.

Fixed my issue, thanks 👍

szpak commented

Great to hear. You may want to subscribe to that issue to be informed when (if) it is fixed.

*hear ;)