Grails Dependency Resolution

I am a little new to Grails. I have an application that works fine in Eclipse, but when I deploy during production, it crashes due to missing dependencies.

When I run the dependency report, it shows that all dependencies are automatically present for 'build' but not for 'runtime'.

What is the easiest way to transfer dependencies from the runtime, so (hopefully) they will be copied to my war file?

In addition, I use the sanitizer plugin. This works fine in development, but dependencies missing from "runtime" fall like that. If I manually add, for example, one of the dependencies in BuildConfig.groovy ("org.owasp.antisamy: antisamy: 1.4.3"), then grails crashes with this error:

bootloader restriction violation: the bootloader (instance) previously initiated a boot for another type named "org / xml / sax / SAXParseException"

I suppose this is a problem with the classpath, but I'm not sure why this only happens when I manually add a dependency - is it for sure all the time?

+3
source share
1 answer

You're right, you need to add the missing time dependencies to BuildConfig.groovy. The easiest way is to copy them from the BuildConfig.groovy plugin to your application. You must also raise JIRA for the corresponding Grails plugin to get this fixed upstream.

Maven , pom. BuildConfig.groovy, :

runtime('org.owasp.antisamy:antisamy:1.4.3') {
   transitive = false
}

"transitive = false" , ,

excludes "xml-apis", "xerces"

"runtime".

+2

Source: https://habr.com/ru/post/1795738/


All Articles