I\'m creating a Grails Plugin as a wrapper for a complex product. This product has a lot of dependencies to other products like hibernate. The issue is, that grails has some
Grails has a dependency resolution mechanism that resolves conflicts among the dependencies of:
Just make sure that you specify what your plugin depends on, and let Grails' dependency resolution take care of the rest. Grails historically used Ivy for dependency resolution, but starting with Grails 2.3.0 the default is Maven/Aether with the option to use Ivy.
Occasionally in an application, you'll want to override the choices made by the dependency resolution, e.g. exclude a transitive dependency or force a particular library version to be used, you can do all this in BuildConfig.groovy
As usual, the Grails reference document provides very comprehensive coverage of this topic.
Further to your comment below, if you put a JAR in the lib directory of your application it will be ignored by the dependency resolution and placed on your classpath directly. So you shouldn't normally do this. Specify the JAR and it's version in the dependencies
section of BuildConfig.groovy
instead.
The syntax for specifying a JAR is
<scope> <group>:<artifact>:<version>
group, artifact, and version collectively identify what (JAR) you want to download, whereas scope specifies how you want to use the JAR. The easiest way to find the group, artifact, and version of a particular JAR is to search a Maven repository.
Read this to learn about the different scopes you can use.