Should I exclude the Grails Wrapper from my git repository? - grails

I've never used the Grails Wrapper before. My preferred method has been SDKMAN so far.
I understand the purpose of the wrapper and basically how to use it. However I have no idea how it works.
Now, I have a couple of questions if I were to use the wrapper
Should I exclude grails-wrapper.jar and/or grailsw from my git repository (.gitignore)?
When it comes to a minor Grails version upgrade (let's say 4.0 --> 4.1), should I manually replace any of those files?
Is there any difference with upgrading a major Grails version (let's say 4.x --> 5.x)
My questions concern to any version of Grails (3.x, 4.x, 5.x) since the wrapper reinstatement in Grails 3.2.3

I've never used the Grails Wrapper before. My preferred method has
been SDKMAN so far.
I use SdkMan too, but it serves a different purpose. Using grailsw means that as you switch back and forth between projects which use different versions of Grails, you don't have to reconfigure the environment as you switch back and forth between those projects. The grailsw is configured within the project to use the appropriate version of Grails for that project.
Should I exclude grails-wrapper.jar and/or grailsw from my git
repository (.gitignore)?
No.
When it comes to a minor Grails version upgrade (let's say 4.0 -->
4.1), should I manually replace any of those files?
I do. For many cases the files won't have changed, and when they have, including them as part of the upgrade is simple and should be done.
Is there any difference with upgrading a major Grails version (let's
say 4.x --> 5.x)
No.

Related

Can i upgrade directly from Grails 2.x to Grails 4.x bypassing all median levels

I am having an application build on grails 2.2.4. I need to update it to grails 4.0.8 Can i upgrade directly. As i checked from various sources, i need to jump first from 2.2.4 to 3.x then thereafter 3.x to 4.x. Please suggest me optimum way to do this upgrade.
Similar to other question about Grails upgrades
Major version upgrades in Grails are rarely trivial. I'd suggest starting a new app in the target version, and migrating classes/functionalities.
In Grails framework, the effort required to update your application depends on multiple factors, such as:
The standard practices. For instance, the persistence stuff in the Grails services instead of controller or domains itself.
The underline plugins your application depends on. You would need to update to the latest version of the plugin, or in some case find an alternative approaches as the plugin may longer be maintained, or there maybe better ways of doing it. For instance, we had some custom plugin for multi-tenancy back when I started with Grails, But now, GORM has great support for multi-tenancy.
I personally think you should directly jump from Grails 2 to Grails 4 by creating a new application, and then move your source code. But, first you need to identify all the variables such as plugins or libraries.

Grails upgrade from 1.2.2 to version that supports multiple datasources

I have several applications created with grails 1.2.2. I need to modify one of these applications to work with multiple datasources. It seems that my best option is to upgrade to a new version of grails. I'm worried that trying to go straight to grails 3 will cause major issues, but am not sure which versions to step through if I'm going to upgrade gradually. Any advice? I apologize for this being so open ended.
The first info about support for multiple databases in official docs exists in version 2.0.0:
http://docs.grails.org/2.0.0/guide/conf.html#multipleDatasources
Check out this guide for upgrade:
http://docs.grails.org/2.0.0/guide/gettingStarted.html#upgradingFromPreviousVersionsOfGrails

Grails 2 vs Grails 3

I'm rather new to grails and I'm about to start a new grails project. I'm very confused with what version to go with based on the tools not being ready to support the newest version. I've read version 3 was a complete rewrite from ground up which my gut says should be the version to go with considering the project is brand new, but I'm discovering none of the tools are ready for version 3.
I was successfully able to get version 3 up with intellij with out grails support and the same goes for ggts.
With that being said, I don't know how to run the app in ggts since grails-runapp doesn't work
with ggts, I used the following tutorial https://tedvinke.wordpress.com/2015/04/10/grails-3-released-installing-gradle-and-groovy-2-4-support-in-eclipseggts/ but I've been able to figure out how to get the app to run. Does anybody know how to do this?
My questions are
How do I run a Grails 3 app in GGTS.
Is it recommended to use Grails 3 at this point or should I use Grails 2
If you use Grails 3, what is the recommended IDE?
With Intellij I had to run it by going to the grails-app/init project run main. Is this the correct way to do it?
As of Grails 3 you don't need a special IDE To run Grails 3 application. all you need to do is to right-click on the Application class and execute to start your Grails application. To read more about IDE integration https://grails.github.io/grails-doc/latest/guide/introduction.html
Currently, not all plugins are upgraded to Grails 3. So if your project depends on some plugins that are not already upgraded this will be an issue. For example spring security is not upgraded yet, but there is a work around to use it.https://groups.google.com/forum/#!searchin/grails-dev-discuss/spring$20security/grails-dev-discuss/jOF0jw_BiCs/tOxd0NZpaxkJ
Finally, both Intellij community edition and GGTS supports Grails3. But if you want special grails features like GSP syntax highlighting use GGTS or IDEA Ultimate edition.
IntelliJ idea 15 is out. Try that. The support for Grails 3 is built in.
Choose Grails 3 instead of Grails 1/2 in project selection.
I have 6 projects running Grails 2 for over 1 year.
So far I have not encountered any need to upgrade them to Grails 3.
I use the latest edition of IntelliJ Ultimate 2016.2, and for the most part it works good with Grails 2. The debugger still throws a lot of EVAL errors, but I am able to evaluate my variables in real time.
The biggest problem I've encountered so far is plugins that are not compatible with Java 1.8. Some of the plugins still have to run in Java 1.7.
Lastly, I'd say if your project is still new, look into using NodeJs. It seems to be more popular than Grails at this point.
I think intellij is better for development in grails from my experience.
Grails 3 will be good choice for development. there are lot more features in there
https://dzone.com/articles/whats-new-grails-3
also document site will give you clear concept about it
http://docs.grails.org/latest/
Considering the fact that grails version 2 is different from grails version 3; it will be good if you start with version 3 and avoid the possibility of running into upgrade issues from 2.x to 3.x in the future
You can use Netbeans or Intelij. I use Netbeans.
Facing a lot of issues in Database migration in Grails 3.1.6. Not helping at all.
I think remaining a few days in version 2 will be beneficiary as long as version 3 stables.
Besides The GGTS support will be needed as Intellij IDEA 15 community edition does not support Grails. So better back to the old versions.

Which Grails version is more compatible with current plugins list?

I'm trying with the 2.5.0 release of Grails but I have had problems of compatibility with some plugins I've tried (for example searchable)
Which version of Grails you recommend to start a new project? I'd like to start with the version more compatible with the list of current Grails plugins https://grails.org/plugins/
I'm not interested with the newer version but with the most compatible/stable with the current plugins list.
Both 2.4.x and 2.5.x will work fine with the current plugins in general.
Without any details it's hard to know why the searchable plugin isn't working for you, but note that it only works with Hibernate 3 and the default in new Grails apps is to use Hibernate 4. But you can see that the Hibernate 3 configuration settings are commented out in BuildConfig.groovy and DataSource.groovy so you can easily change back to Hibernate 3.
Having said that, don't use searchable. The underlying Compass library is no longer maintained, and using the searchable plugin will cause scaling problems because it's very inconvenient to get it to use a shared index between servers. The author of Compass created Elasticsearch, and that's a much better option. There's also an actively maintained plugin for it.

Grails - Upgrade and downgrade version of the project

I made an example project in grails 2.3.8. How to upgrade to the newest version? No way to downgrade from version too?
It really depends on the differences between the versions. In a lot of cases you will get away with simply editing the version number in the application.properties file at the top of the project. There used to be a grails upgrade command which attempted to do some of the work for you but that approach proved to be problematic for a number of reasons so it was removed in Grails 2.4. The normal upgrade procedure now is to edit the version number, which can be done using the grails set-version command (which just updates application.properties, see http://grails.org/doc/latest/ref/Command%20Line/set-grails-version.html) and then reading release notes for any other particulars related to that release. Often the release notes suggest updating some specific plugins to specific version numbers for compatibility.
Downgrading generally could be done with the same approach. Depending on what is in your application you might run into problems going backwards in versions.
I hope that helps.

Resources