0
votes

we've developed a grails application along with a number of grails plugins.These grails plugins gets included as a jar in the main application.We've maintained a artifactory where we publishing our plugins jars. Now there are a number of problems we are facing in this approach.

problem 1:

whenever we need to do a change in a plugin ,we've to go to the plugin project ,then compile it , publish it and then upgrade the jar version in main application. This process gets very tedious when we've a number of projects. We're using intellij for development.Is there any thing we can do, that we open our project along with our plugins then test everything without publishing individual plugins.And when the testing is complete then a gradle build will publish those plugin jars automatically

problem 2 ==> (related to problem 1)

We have a grails 3.0.10 application and we're trying to upgrade it to 3.1.11 version. In our application ,We use a number of grails plugins which are also written in grails 3.0.10.When we're trying to upgrade our main application to 3.1.11 it thows some errors in plugins. One solution to this problem is to go through each plugin and compile them in grails 3.1.11. But We want to know whether there is any other option available so that i just need to update my main application.

1
You should seriously be considering setting up Jenkins or something to manage the build process and grails version checking in the code then letting the build process do all the builds for you. The reason it is tedious it sounds like because it is a manual process. You could even script it. Regardless there were changes between 3.0 and 3.1 and a recompile of the plugins will be required. - V H

1 Answers

0
votes

Grails does support inline plugins.

This means, that you have the source of some Grails plugins on your disk alongside your Grails app.

assuming the name of your custom plugin is "my-test-plugin", place something like this in the app's BuildConfig.groovy (toplevel of file structure):

grails.plugin.location.'my-test-plugin' = '../custom_plugins/my-test-plugin'

and of course disable the plugin dependency for a fixed version.

that way you can temporarily adjust the buildconfig (while you are actively working on the plugin) and revert it as soon you release a new version of the plugin.

or, you can leave it like that, but in that case you should find a path convention that every team member has to use (or everybody has to adjust the relative/absolute paths in buildconfig and should not commit that)

hope that helps

edit: my answer only is for Grails 1.x and 2.x

for Grails 3 inline plugins see Adding in-place plugin to grails 3 project