veloc1
(Pavel Bartashuk)
March 16, 2018, 12:35pm
1
Currently I have a project with some plugins, that will be published to private maven, but before publishing I want to test this plugins. I’ve created test project like this:
plugins
|- src
|- test
|- build.gradle
test-project
|- build.gradle
|- settings.gradle
And in test-project/settings.gradle
I’ve included plugins:
includeBuild '../gradle-plugins'
And then I try to apply one of plugins in test-project/build.gradle
:
plugins {
id 'groovy'
id 'com.company.plugin' // here I got an error "Plugin was not found"
}
Is there a way to apply plugin in layout like that?
nerro
(nerro)
March 16, 2018, 2:15pm
2
I think id
works only for published plugins.
Can you try so: apply plugin: "<YOUR-PLUGIN-ID-FROM-PROPERTY-FILE>"
?
You can find plugin id in *.properties file (https://docs.gradle.org/current/userguide/custom_plugins.html#sec:custom_plugins_standalone_project )
veloc1
(Pavel Bartashuk)
March 16, 2018, 2:24pm
3
Thanks for reply!
Just tried that, did’t work
Also tried to use apply from
just in case, not work too
nerro
(nerro)
March 16, 2018, 2:32pm
4
Can you upload example project? So I can figure it out how to fix it.
veloc1
(Pavel Bartashuk)
March 16, 2018, 3:12pm
5
Sure. Thanks for helping me!
There is a link to sample repo: github
I’ve also included code with workaraund at test-project/settings.gradle
for further searchers. The idea is: publish plugin to private maven repo as snapshot. But there is another problem, pluginManagement can’t include snapshot modules or modules with dynamic versions, so I should specify every new version by hand
nerro
(nerro)
March 16, 2018, 8:54pm
6
It looks like you have some issues with plugin configuration (and package names were incorrect). I guess you copied it from existing project.
Check PR from your project (https://github.com/veloc1/gradle-plugin-in-included-build-sample/pull/1 ). It works on my machine
This gradle example helps me (https://github.com/gradle/gradle/tree/v3.1.0/subprojects/docs/src/samples/compositeBuilds/plugin-dev ).
1 Like
veloc1
(Pavel Bartashuk)
March 19, 2018, 12:38pm
7
Wow, thanks!
My bad, didn’t notice samples/compositeBuilds and missed links to this plugin java gradle plugin . Documentation is really unclear about that.
Problem resolved now, thanks for help, @nerro !