xvik / gradle-quality-plugin

Gradle quality plugin for Java and Groovy
http://xvik.github.io/gradle-quality-plugin
MIT License
134 stars 11 forks source link

Version 3.1.0 fails to run #9

Closed jjathman closed 6 years ago

jjathman commented 6 years ago

Upgrading to version 3.1.0 gives me this error (works fine in version 3.0.0).

Caused by: org.gradle.internal.event.ListenerNotificationException: Failed to notify project evaluation listener.
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:86)
        at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:324)
        at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:234)
        at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:140)
        at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)
        at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
        at com.sun.proxy.$Proxy26.afterEvaluate(Unknown Source)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:76)
        ... 85 more
Caused by: java.lang.NoClassDefFoundError: com/github/spotbugs/SpotBugsPlugin
        at ru.vyarus.gradle.plugin.quality.QualityPlugin.applySpotbugs(QualityPlugin.groovy:183)
        at ru.vyarus.gradle.plugin.quality.QualityPlugin.access$7(QualityPlugin.groovy)
        at ru.vyarus.gradle.plugin.quality.QualityPlugin$_apply_closure1$_closure16.doCall(QualityPlugin.groovy:84)
        at org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(ClosureBackedMethodInvocationDispatch.java:40)
        at org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(ClosureBackedMethodInvocationDispatch.java:25)
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:42)
        at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:230)
        at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:149)
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:58)
        ... 92 more
Caused by: java.lang.ClassNotFoundException: com.github.spotbugs.SpotBugsPlugin
        ... 101 more
xvik commented 6 years ago

Gradle can't download spotbugs plugin, available ony(!) in grdle plugins repository.

I assume you attaching plugin with the old syntax like (because otherwise everything would work):

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'ru.vyarus:gradle-quality-plugin:3.1.0'
    }
}

and you did not specify gradlePluginPortal() as repository. Just add it and everything will work:

repositories {
        jcenter()
        gradlePluginPortal()
}

Previous spotbugs plugin version (1.6.1) must be cached locally (or on your nexus) and so you don't have problems with 3.0.0, but new version is required now (1.6.2) for gradle 4.8 compatibility.

jjathman commented 6 years ago

You are correct, we are using the old syntax. It looks like the problem is that we use Artifactory to proxy all of our dependencies and it doesn't look like it supports the new plugin lookup syntax. We have Artifactory configured to look at https://plugins.gradle.org/m2/ but apparently that is no longer good enough.

You may want to make a note about this in your release notes, I would not have expected this to happen and it's the first time we've run in to this problem as far as I know.

jjathman commented 6 years ago

This is a little confusing to me, why does version 3.0.0 have a compile dependency on the spot bugs plugin (http://mvnrepository.com/artifact/ru.vyarus/gradle-quality-plugin/3.0.0) but version 3.1.0 doesn't list it (http://mvnrepository.com/artifact/ru.vyarus/gradle-quality-plugin/3.1.0).

I'm not getting errors from Gradle saying it can't download the plugin which is what I would expect if I had something configured incorrectly. It looks like the plugin is just assuming Spot Bugs is available even though it doesn't list it as a dependency.

xvik commented 6 years ago

Mmm thank you! You are right, that is not correct. Pom in plugin portal is different and everything works with new plugins syntax (and so I didn't noted this problem). I will definitely fix that.

jjathman commented 6 years ago

Great, thank you for looking in to it!

xvik commented 6 years ago

version 3.1.1 released