Is it possible to change the profile of an existing Grails application?

Viewed 614

I am working on an existing Grails 3.1.15 / Angular 4 project. The project was set up with the default "web" profile, although we're only using Grails for REST calls. I would like to upgrade to Grails 3.9 with the "angular" profile. Is it practical to attempt this manually, or should I create a new Grails app?

2 Answers

You can switch profiles, but I think doing, so would just change the available actions in Gradle, to create new artifacts. Changing profiles, won't add it remove dependencies, like if you want JSON views. Creating a new app with a different profile is a quick way to see what dependencies are added to the build.gradle.

If I were you I would just update, and look to see if there were other features like JSON views you want and add the dependencies, you need for them. You could also remove dependencies that you are not using, although be careful to test to make sure you are not using a dependency.

Is it practical to attempt this manually, or should I create a new Grails app?

I would say "no". It is possible, but not practical. You would have to have a lot of info in your head to effectively do it manually and there is no reason to do that. The simple thing to do is create a new project with the profile you want to use and copy the contents of that newly created project, the whole directory structure, into your existing project and diff to see what changed. That sounds like a major thing, but it is like a 2 minute endeavor for most projects.

Related