Looking for integrate-with in grails 3.x - grails

the command
grails integrate-with --foo
is gone in grails 3.x. Has that functionality not been implemented yet, or is it hiding somewhere I don't know where to find it?

As mentioned in the comments, there's no need for the IDE integration command, but an auto-generated .gitignore file is definitely nice to have and something that was missing in the early 3.x releases.
Since Grails 3.0.5, a .gitignore file is created by default with the create-app command.
See the GitHub issue: Default integration with Git on grails create-app command.

Related

Grails 3.1.9 missing command (create-functional-test)

I want migrate Geb functional tests from 1.3.7 to 3.1.9. Tried to create a new plain test with grails create-functional-test in IntelliJ an via console. Both failed with Command not found create-functional-test.
I created a new application with grails create-app and tried again grails create-functional-test, it works as expected.
Compared and improved all Grails dependencies in build.gradle.
Any ideas how i can fix this issue?
EDIT:
If i uncomment this line: //compile "org.grails.plugins:geb:0.13.1" in build.gradle File it is possible to create a Testfile but of course Grails does not know the GebSpec class.
EDIT 2: I solved it!
The old Plugin, see above, caused the problem. I deleted the dependency and reimported my apllication, know it works.

How do I configure installation of plugins in Grails 3.0.4?

I'm porting an application from Grails 2.4.2 to Grails 3.0.4, and I'm having problems with some plugins that were installed previously. Specifically one that is referenced in a GSP page. The particular plugin is called google-visualizer, and I've found some info here:
https://github.com/bmuschko/grails-google-visualization/blob/master/grails-app/views/formatter/index.gsp
However, I am clueless as to how to install this. I have not found the particular jar file in any maven repo, so I can't add it as a Gradle dependency. In general, where is it documented how to install existing plugins in Grails 3.X? I've read the documentation on how to port existing plugins, but that's not what I'm trying to do. I simply want to tell Grails/Gradle that I'd like to use this particular plugin and have it resolve the dependencies for me. I've tried this syntax as shown here:
https://grails.org/plugins/tag/grails3
Example:
compile ":quartz:1.0.2"
I've put that line in the dependencies block in my build.gradle file, but it doesn't work. I get errors from Gradle. Is there a particular Maven repo that has to be added for plugins? Any help with this is appreciated. Thanks.
Grails 1.x and 2.x plugins are sadly not compatible with Grails 3.x.
You can find the plugins that already have been ported to Grails 3 at: https://bintray.com/grails/plugins/
The grails-google-visualization plugin is not released in a Grails 3 version, but from the repo, it appears that work has started on upgrading.
You can see the progress on a Grails 3 version in this issue: https://github.com/bmuschko/grails-google-visualization/issues/49
Benjamin searched for a new maintainer back some time ago, and found a volunteer - see this tread for details: https://twitter.com/bmuschko/status/498610606896066560
For those plugins that are most important, the Grails Core team maintains a list here: https://github.com/grails/grails-core/wiki/Grails-3-Priority-Upgrade-Plugins
Some of the old plugins will be replaced by their Gradle counterpart, fx. the codenarc plugin, that exist in a Gradle version already.
A simple way is to find out the JAR file for the plugin and then use them in Grails 3.0.4. In this way there is no need to change the source code of the plugin

How to add or install plugins in grails-3.0.4 which i have used in grails-2.4.4 while upgrading application

1) How to add or install plugins in 3.0.4 like in 2.4.4 we can install by specifying in BuildConfig.groovy?
2) How to create new plugins and copy source code to new plugins from original plugins as documentation saying to do for up-gradation of plugins in grails-3.x?
You add your plugins into the dependencies block in your build.gradle. You find plugins here - as stated on the plugin page.
Follow the instructions in the Upgrading from Grails 2.x - Reference Documentation
In a nutshell, migrating involves:
Creating a brand new Grails 3 app/plugin.
Copying the source from the Grails 2 project over to the new project. By source I mean controllers, domains, services, and other Grails artefacts, NOT configuration such as Config.groovy, BuildConfig.groovy, etc.
Reconfiguring the new project according to the changes made in Grails 3. This includes going from Config.groovy to application.yml, setting up the dependencies on Grails 3 versions of the plugins, relocating BootStrap.groovy, etc. As #cfrick mentioned, the Upgrading from Grails 2.x - Reference Documentation is your friend.
Fix all the compile time and runtime errors. Most likely you will have a lot of them.
An indiscriminate copy like cp -rf OldProjectPath NewProjectPath will not work. I recommend checking for Grails 3 versions of your plugins to see how many have been ported. That will tell you if this is the right time to migrate.

Using Grails 2.4.3 in IntelliJ

I've been unable to create/import a Grails 2.4.3 project with IntelliJ 13.1.4. For example, when I create a new module, choose Grails, then click the create button (highlighted below) and choose the location where Grails 2.4.3 is installed, the project is not created correctly (I get a module with just a /src directory instead of a Grails project) and Grails 2.4.3 is not added to the list of Global Libraries. I don't have this problem with any earlier version of Grails.
I have used Grails 2.4.2 with Intellij 13.1.4 successfully. What I did is create the application with the grails create-app command and then do a File / Import Project in Intellij. Give that a try.
As an alternative solution to the IntelliJ 13.1.4 and Grails 2.4.3 bug you can:
grails create app <app-name>
cd app-name
grails integrate-with --intellij
This configured the project correctly for me with just minor tweaks to SDK and application server. This is a minor twist on the work around described above.
See grails doc here
I had the same problem with IntelliJ 13.1.4 and Grails 2.4.3, which i just downloaded.
After using the grails create-app command from the command line i had to import the project, by "create from existing sources" (point to the new top level folder), "Configure SDK" (to set for the Grails 2.4.3) and finally edit the run configuration. In a second test run with a new test project i did not have too configure the run config.
Then the Grails libs for the were downloaded and the basic app ran. Also the Grails specific option in the Intellij "Tools2 section were suddenly available.
So the given answer by Joe is the way to setup a new Grails project but the IDE should be fixed anyways.
It is not consistent. After several tries I can get some applications to work but it does not seem to be automatic. I think I am going to go back to Grails 2.4.2 until this is resolved within Intellij 13.1.4.
In the screenshot above, there are options for groovy/grails/griffon, and so far the alternative offered was command-line. Try choosing groovy option within intelliJ.
We are using IDEA 13.1.4 with grails 1.3.7 and grails 2.2.1(diff projects) and saw the same issue. It appears this is an intelliJ issue and not so much the grails version, so reverting your grails won't gain you anything. Choosing groovy, you should see a prompt for grails directory structure. This does work if you are presented with this option. Seeing inconsistencies here. Thanks to all for posting your workarounds; never hurts to have multiple approaches.
-Duane

Were the generate-* commands removed from Grails 2.3.2?

When I type generate-all, generate-controller or generate-vies, Grails current version (2.3.2) does not recognizes them. However, these commands remains on the Grails documentation. Does anyone knows if these commands were removed (and the docs are not up-to-date)?
Try grails compile first.
These commands are now part of the scaffolding plugin, and you might need to get grails to fetch the plugin

Resources