Installing Grails Spock Plugin in 2.0.0M1 - grails

I'm kicking the tires on Grails 2.0.0M1 and Springsource Tool Suite 2.7.1, but I'm having problems installing the spock plugin.
When I run "grails install-plugin spock 0.6-groovy-1.8-SNAPSHOT" I get:
| Downloading: spock-0.6-groovy-1.8-SNAPSHOT.pom
:: problems summary ::
:::: ERRORS
grailsCentral: bad organisation found in http://svn.codehaus.org/grails-plugins/grails-spock/tags/RELEASE_0_6-groovy-1_8-SNAPSHOT/spock-0.6-groovy-1.8-SNAPSHOT.pom: expected='org.grails.plugins' found='org.spockframework'
| Error resolving plugin [name:spock, group:org.grails.plugins, version:0.6-groovy-1.8-SNAPSHOT]. Plugin not found.
| Error Plugin not found for name [spock] and version [0.6-groovy-1.8-SNAPSHOT]
Any idea how to work around this?

Had the same problem. This was fixed earlier today. Try grails install-plugin spock 0.6-SNAPSHOT (without "groovy-1.8").
See:
http://jira.grails.org/browse/GPSPOCK-5?focusedCommentId=65695&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-65695

Grails 1.4/2.0 requires Groovy 1.8, but they have some problems with getting Spock version with support for it into Maven Central. The method described here worked OK for us with Grails 1.4.M1. It's a little cumbersome, because it requires to manually build the JAR and install it into the local Maven repository (thus, needs to be performed on every machine), but you can also try to deploy it to a local Nexus/Artifactory.

Related

How to install grails db-reverse-engineer

Trying to use the Grails db-reverse-engineer plugin. As this plugin doesn't work with Grails 3 I used SDKMAN to install older versions of Grails just to generate the models. First tried version 2.5.2 (which was still incompatible with the tutorial) and then spun back to 2.2.5. Following the tutorial still fails to install the plugin:
$grails create-app reveng-test
| Created Grails Application at /home/user/pnvStuff/grails/reveng-test
$ cd reveng-test
$ grails install-plugin db-reverse-engineer
| Environment set to development.....
| Warning The install-plugin command is deprecated and may be removed from a future version of Grails. Plugin dependencies should be expressed in grails-app/conf/BuildConfig.groovy. See http://grails.org/doc/2.2.x/guide/conf.html#pluginDependencies.
| Error resolving plugin [name:db-reverse-engineer, group:org.grails.plugins, version:latest.integration]. Plugin not found.
| Error Plugin not found for name [db-reverse-engineer] and version [not specified]
I also tried installing the plugin by referencing it in the plugins section of the BuildConfig.groovy.
runtime ':db-reverse-engineer:0.5.1'
How can I get this plugin installed to generate the needed domain classes?
Grails 2.x (and 1.x for that matter) plugins are now in a repository that isn't included in BuildConfig.groovy by default. You need to add the below Maven repo to your dependency resolution block.
grails.project.dependency.resolution = {
repositories {
mavenRepo "http://repo.grails.org/grails/repo/"
...

Bamboo/grails error 2.4.4 Error Script not found: Upgrade

When I run grails war, on Bamboo, I get the following error.
13-Apr-2015 11:15:53 | Configuring classpath
13-Apr-2015 11:15:59 | Running pre-compiled script
13-Apr-2015 11:15:59 | Error Script not found: Upgrade
Now I know that grails upgrade command has been removed from 2.4.4 so this is the cause but why is it (Upgrade) calling it in Bamboo. I have updated grailsw and grailsw.bat to be 2.4.4 but is still calling it? My app is set to 2.4.4 (application.properties). What could be the reason it is calling this(Upgrade) and/or how do I stop it?
From what I can tell, being in the same boat, the grails plugin itself is calling grails upgrade before running any commands you put in there.
The way I've got this working with 2.4.4 is to use a command instead of the build-in grails task.
My command simply maps to C:\grails\grails-2.4.4\bin\grails.bat and I just pass it command line args: -Dgrails.env=alpha war myApp-alpha.war
It's not as seamless doing multiple commands (like, clean -> test-app -> war), but you can do individual commands for each one, depending on the needs.
It looks like, its a Bamboo plugin for Grails has some bug.
For work around:
You! Could have added dummy upgrade script into your code.
For adding upgrade script:
grails create-script upgrade
After adding upgrade script, it will fix missing upgrade script issue on Bamboo.

Install Mail Plugin - says that install-plugin is deprecated

I got this warning when i tried to install the mail plugin.
Loading Grails 2.2.4
| Environment set to development.....
| Warning The install-plugin command is deprecated and may be removed from a future version of Grails. Plugin dependencies should be expressed in grails-app/conf/BuildConfig.groovy. See http://grails.org/doc/2.2.x/guide/conf.html#pluginDependencies.
| Resolving plugin mail. Please wait...
The command i used was install-plugin mail. When i checked the documentation it as well shows me the same command.
Can someone direct me by telling me what the correct command is?
You don't need to run any command, just declare the plugin dependency in BuildConfig.groovy like so:
plugins {
runtime ":mail:1.0.4"
}
Remove any reference to the plugin that may exist in application.properties.

Why grails run-app tries to access remote servers during compiling

I found there are some errors during my grails application compiling.
| Loading Grails 2.0.4
| Configuring classpath
:: problems summary ::
:::: ERRORS
Server access Error: Unexpected end of file from server
url=http://plugins.grails.org/grails-shiro/tags/RELEASE_1_2_0-SNAPSHOT/shiro-1.2.0-SNAPSHOT.pom
But I can access the above url using my browser. What does the error mean? and is there any way to avoid such problems during compiling? Or can I compile my grails app locally?
when I need some grails plugin, I usually run
grails install-plugin xxx
to install xxx plugins. I noticed that there are some records automatically written in 'application.properties'. And the plugins are always installed in my ~/.grails//projects/plugins/, I am wondering whether there are ways to compile grails app locally?
You have a SNAPSHOT plugin, that means that Grails have to refresh this plugin periodically (once a day).
To disable remote repositories you can use --offline to work offline:
grails --offline run-app
Or disable it completelly by adding into BuildConfig.groovy:
grails.offline.mode=true
See docs for Dependecy Resoultion - https://grails.github.io/grails2-doc/2.0.4/guide/conf.html#dependencyRepositories
P.S. Latest stable version of Shiro plugin is 1.1.4, you could also use it instead of 1.2.0-SNAPSHOT. Stable version will be downloaded only once.

Grails install-plugin git Error

Environment
Windows 7, Grails 2.2.0/2.X, GGTS
I have installed git on my computer successfully, I am now trying to install the Git plugin for grails using the command install-plugin command. I get the errors below, I have looked for a solution but have not found one yet.
Problems occurred (un)installing plugins. See details for more information
------System.out:-----------
| Loading Grails 2.2.0
| Configuring classpath.
| Environment set to development.....
| Warning The install-plugin command is deprecated and may be removed from a future version of Grails. Plugin dependencies should be expressed in grails-app/conf/BuildConfig.groovy. See http://grails.org/doc/2.2.x/guide/conf.html#pluginDependencies.
| Resolving plugin git. Please wait...
| Error resolving plugin [name:git, group:org.grails.plugins, version:1.0-SNAPSHOT]. Plugin not found.
| Error Plugin not found for name [git] and version [1.0-SNAPSHOT]**
------System.err:-----------
i faced this problem when i was installing the searchable plug in but i figured out that my internet connection is through proxy so i got direct connection and it was installed successfully
Sherif
I ended up using the grails integrate-with --git command instead

Resources