ghale / gradle-jenkins-plugin

Gradle plugin to programmatically configure Jenkins jobs.
123 stars 42 forks source link

Seeing issues with Gradle 2.4 #56

Open ysb33r opened 9 years ago

ysb33r commented 9 years ago

Assuming that a build script contains something like

views {
        "someName" {
            dsl {
                        }
                }
}

under Gradle 2.4 this will cause an exception similar to below

Caused by: groovy.lang.MissingMethodException: No signature of method: java.util.LinkedHashSet.sort() is applicable for argument types: (java.lang.String$CaseInsensitiveComparator) values: [java.lang.String$CaseInsensitiveComparator@723877dd]
Possible solutions: sort(), sort(groovy.lang.Closure), sort(boolean), sort(groovy.lang.Closure), sort(boolean, groovy.lang.Closure), sort(boolean, java.util.Comparator)
        at javaposse.jobdsl.dsl.views.ListView$_jobs_closure2_closure5.doCall(ListView.groovy:33)
        at javaposse.jobdsl.dsl.views.ListView$_jobs_closure2_closure5.doCall(ListView.groovy)
        at javaposse.jobdsl.dsl.MissingPropertyToStringDelegate.methodMissing(MissingPropertyToStringDelegate.groovy:39)
        at javaposse.jobdsl.dsl.MissingPropertyToStringDelegate.invokeMethod(MissingPropertyToStringDelegate.groovy)
        at javaposse.jobdsl.dsl.views.ListView$_jobs_closure2.doCall(ListView.groovy:31)
        at javaposse.jobdsl.dsl.WithXmlAction$_execute_closure1.doCall(WithXmlAction.groovy:18)
        at javaposse.jobdsl.dsl.WithXmlAction$_execute_closure1.doCall(WithXmlAction.groovy)
        at javaposse.jobdsl.dsl.WithXmlAction.execute(WithXmlAction.groovy:17)
        at javaposse.jobdsl.dsl.WithXmlAction$execute.call(Unknown Source)
        at javaposse.jobdsl.dsl.View$_getNode_closure5.doCall(View.groovy:58)
        at javaposse.jobdsl.dsl.View.getNode(View.groovy:58)
        at javaposse.jobdsl.dsl.View.getProperty(View.groovy)
        at javaposse.jobdsl.dsl.View.getXml(View.groovy:50)
        at javaposse.jobdsl.dsl.View.getProperty(View.groovy)
        at com.terrafolio.gradle.plugins.jenkins.dsl.ViewDSLSupport.evaluateDSL(ViewDSLSupport.groovy:45)
        at com.terrafolio.gradle.plugins.jenkins.dsl.DSLSupport$evaluateDSL$0.call(Unknown Source)
        at com.terrafolio.gradle.plugins.jenkins.dsl.JenkinsView.dsl(JenkinsView.groovy:76)

The exception is thrown from javaposse, but is it posssible that what the plugin is passing down could be different under Gradle 2.4?

ghale commented 9 years ago

Schalke,

I've not been able to reproduce this problem. I've tried with the barebones example above and with a fairly complicated test project, but no issues. Is there something unique about your project that might be coming into play (e.g. custom groovy library, forced version of job-dsl-core, etc)?

ysb33r commented 9 years ago

THere is a custom built 2.4, but I would not suppose that to be the issue. I'll retry it with 1.3.1.

ywelsch commented 9 years ago

I encountered the same issue some time ago, had to do with the groovy version being used (see http://jira.codehaus.org/browse/GROOVY-6900 ). The issue was usage in an older version of the JobDSL plugin of a method that is not compatible with newer groovy versions. This has been fixed in later versions of the plugin (>= 1.28 if I remember correctly).