0

I want to exclude some Grails 3.1.9 Plugins for deploying, because i do not need them in production. I know i can use provided instead of compile but then all dependencies of this Plugin are also excluded even if a other plugin have the same dependencies.

Example:

  • Plugin 1 depends on mail.jar and log.jar
  • Plugin 2 depends on log.jar and math.jar

snippet of build.gradle:

dependencies{
  compile "com.plugin1"
  compile "com.plugin2"
}

If i run gradle war, in the resulting archieve file I can find mail.jar, log.jar and math.jar. In production I do not need plugin1 so I change dependencies-block like this:

dependencies{
  provided "com.plugin1"
  compile "com.plugin2"
}

After gradle war it only includes math.jar.

How can i change the build.gradle file in order to pack a war- file which includes only plugin2 and all it is dependencies: log.jar and math.jar

Thanks in advance!

se-jaeger
  • 111
  • 1
  • 5
  • Seems like a bug. And most probably a gradle bug. But I would make an issue first in grails-core (on github) – Hans Bogaards Aug 18 '16 at 13:12
  • @HansBogaards, look [here](https://docs.gradle.org/current/userguide/war_plugin.html) i think it is not a bug. – se-jaeger Aug 18 '16 at 13:52
  • Paragraph 47.4 gives the answer, I think. Declaring plugin1 as 'com.plugin1@jar' should work. – Hans Bogaards Aug 19 '16 at 14:46
  • @HansBogaards, i tried to mark some plugins with `@jar`, but then they are also excluded if i start with `run-app`. I need a way to declare some plugins as excluded only for `war` packing. – se-jaeger Aug 20 '16 at 13:10

0 Answers0