Search code examples
grailsgrails-2.0grails-plugin

Cannot see updates on Grails (2.4.3) Plugin


I have a Grails PRJ (2.4.3) with multiple plugin

  • MAIN PRJ
  • Plugin A
  • Plugin B

In Main PRJ the buildConfig.groovy is:

    plugins {
            // plugins for the build system only
            build ":tomcat:7.0.55"

            // plugins for the compile step
            compile ":scaffolding:2.1.2"
            compile ':cache:1.1.7'
            compile ":asset-pipeline:1.9.6"
            compile ":plugin-a:0.1"
            compile ":plugin-b:0.3"
}

After modification on pluginA I execute :

grails clean
grails maven-install
grails mavel-deploy (for remote nexus)

On Main PRJ

grails clean
grails refresh-dependencies
grails run-app 

But when the project starts I cannot see the updates on the PluginA. I must increase version in the plugindescriptor. After this I can see the updates!

Now..

  1. Is possibile to avoid the version increase?
  2. What is the best practice to dev with multiple plugin?

Thanks in advance

Luis


Solution

  • From offical doc:

    Configuration Changing dependencies Typically, dependencies are constant. That is, for a given combination of group, name and version the jar (or plugin) that it refers to will never change. The Grails dependency management system uses this fact to cache dependencies in order to avoid having to download them from the source repository each time. Sometimes this is not desirable. For example, many developers use the convention of a snapshot (i.e. a dependency with a version number ending in “-SNAPSHOTâ€) that can change from time to time while still retaining the same version number. We call this a "changing dependency".

    Whenever you have a changing dependency, Grails will always check the remote repository for a new version. More specifically, when a changing dependency is encountered during dependency resolution its last modified timestamp in the local cache is compared against the last modified timestamp in the dependency repositories. If the version on the remote server is deemed to be newer than the version in the local cache, the new version will be downloaded and used.

    Then if I use ** - ** SNAPSHOT on my lib , every compile and maven-install will give me a updated lib.