Search code examples
grails

Troubleshoot dependencies in non-Grails


I have an old code in grails 1.3.7, and I need to pass it to grails 2.3.11, but I'm giving those dependency errors, and since I do not have much grails experience, I do not know what I have to do to resolve this error. Can someone help me?

| Error Resolve error obtaining dependencies: Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):

- org.grails.plugins:framework:0.3.1
- org.grails.plugins:tomcat:1.3.7
- org.grails.plugins:audit-logging:0.5.4.coss
- org.grails.plugins:hibernate:1.3.7
- org.grails.plugins:trackable:0.3
- org.grails.plugins:attachmentable:0.2.1

Solution

  • Create new grails 2.3 app and copy its BuildConfig default dependencies over, and remove those that have been updated by your copy paste, atleast the most critical ones to get app running: hibernate and tomcat.

    Then comes the hard part. You need to go over all the rest of the plugins you have and try to find grails 2.x version of the plugin and add the correct version to your config. Many times it does not exist at all so you might have to find a way to implement its behaviour, maybe it was added to grails core in 2.x, maybe it's part of new spring version, maybe not. Maybe the 1.3.7 version of plugin works 'out of the box' with 2.0 but the plugin itself is not hosted anymore so you have to find it somewhere in the internet.

    In extreme cases for missing plugins you could try to fork the code and port it over to grails 2.x. Depending of the complexity of the plugin can be very easy or very difficult.

    Anyway, to tackle this, you should comment the dependencies that are not found but do not prevent application from running, like audit-logging. Then when pieces starts to fall in place and you can run your app and see some pages, add the plugins back one-by-one solving the grails 2.x way to do it.

    If the missing plugins were any popular back in 1.3.7 there is a person before you who asked what is the replacement and there is a way to overcome it in grails 2.x