I am trying to use jetty plugin and doing some custom configuration on jettyRun task like below:
import org.mortbay.resource.ResourceCollection
import org.gradle.api.plugins.jetty.internal.JettyPluginWebAppContext
apply plugin: 'jetty'
webAppDirName = relativePath(processTestResources.destinationDir)
jettyRun {
dependsOn processTestResources
contextPath = '/flp'
webAppConfig = new JettyPluginWebAppContext()
webAppConfig.setBaseResource(new ResourceCollection(['..'] as String[]))
}
However, there is an error
A problem occurred evaluating project ‘:xs-mlm-flp’. > No signature of method: org.gradle.api.plugins.jetty.internal.JettyPluginWebAppContext.setBaseResource() is applicable for argument types: (org.mortbay.resource.ResourceCollection) values: [file:/home/rice/Dropbox/xsf/;]
Possible solutions: setBaseResource(org.mortbay.resource.Resource), getBaseResource()
This is really weird because setBaseResource(org.mortbay.resource.Resource) is the right method since ResourceCollection is a subclass of Resource. Why groovy does not select it?