Grails has a dependency resolution mechanism that resolves conflicts between dependencies:
- Grails itself
- Grails app
- Application plugins
- Plugin dependencies
Just make sure you point out what your plugin depends on, and let Grails dependency resolution take care of the rest. Grails has historically used Ivy to resolve dependencies, but starting with Grails 2.3.0, Maven / Aether with the ability to use Ivy is used by default.
Sometimes in an application, you want to override a selection made by resolving a dependency, for example. exclude transitive dependency or force the use of a specific version of the library, you can do it all in BuildConfig.groovy
As usual, the Grails reference document provides a very comprehensive overview of this section .
Update
In addition to your comment below, if you put the JAR in the lib directory of your application, it will be ignored by dependency resolution and will be directly placed in your classpath. Therefore, you usually should not do this. Specify the JAR and its version in the dependencies section of BuildConfig.groovy .
Update 2
Syntax for specifying JAR
<scope> <group>:<artifact>:<version>
the group, artifact, and version collectively determine which (JAR) you want to load, and the area determines how you want to use the JAR. The easiest way to find the group, artifact, and version of a specific JAR is to look for the Maven repository .
Read this to find out about the various areas that you can use.
source share