Adam, thanks. Your code didn't work exactly for me, but it was more than
enough to get me in the right direction. This appears to have done the
trick:
def void apply(Project project) {
project.plugins.apply(PMDPlugin)
project.dependencies {
pmd 'pmd:pmd:4.2.5'
}
...
}
I really appreciate your response.
On Sun, Sep 4, 2011 at 11:34 PM, Adam Murdoch
<[email protected]>wrote:
>
> On 05/09/2011, at 2:59 PM, lessonz wrote:
>
> I have a plugin that amongst other things, applies other plugins. An
> example
> is the PMD Plugin: https://github.com/ajoberstar/gradle-plugins. When I
> apply my master plugin to a project, I must add:
>
> pmd group: 'pmd', name: 'pmd', version: '4.2.5'
>
> to my project's dependencies or the build will fail. I have tried adding
> this dependency to the my master plugin's runtime dependencies, but it
> doesn't help. I realize it isn't a huge deal that I have to paste this line
> into each of my build scripts that apply my master plugin, but I'd still
> like a way not to have to do so.
>
> Any ideas?
>
>
> From memory, the PMD plugin does not use the plugin classpath to find PMD
> (so that you can easily change the version it uses), so adding it to the
> master plugin's runtime dependencies isn't going to help here.
>
> I would add the dependency in the master plugin, something like:
>
> public void apply(Project project) {
> project.configure {
> apply plugin: 'pmd'
> dependencies {
> pmd group: 'pmd', name: 'pmd', version: '4.2.5'
> }
> }
> }
>
>
> --
> Adam Murdoch
> Gradle Co-founder
> http://www.gradle.org
> VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
> http://www.gradleware.com
>
>