Using snapshots stored in your maven repository with Grails
In my current project, we are developing a core domain library to be shared across different web applications of different companies. We are also developing the new website of one of those companies in Grails. Therefore, we need to declare a Grails dependency on the core domain library which is stored on a Maven repository.
Grails, by default, uses Ant to build the project and Ivy to resolve dependencies. Using maven as a repository is very easy: you only need to declare it on the “BuildConfig.groovy” file.
The problem is that this simple approach does not pick up changes on snapshots. The way I solved this was using “useOrigin true” in the same file.
Here you have the BuildConfig.groovy file:
grails.project.dependency.resolution = {
useOrigin true
...
repositories {
...
mavenLocal()
mavenCentral()
...
}
...
}