Grails plugins getting upgrade and downgrade message for same build - grails

I have grails rest-client-builder plugin installed in my grails application.
Earlier I had 1.0.3, but now I changed the version in BuildConfig.groovy to 2.1.1
Now I am getting this following strange message:
|Environment set to development
.................................
|Packaging Grails application
You currently already have a version of the plugin installed [rest-client-builder-1.0.3]. Do you want to upgrade to [rest-client-builder-2.1.1]? [y,n] y
y
.
|Installing zip rest-client-builder-2.1.1.zip...
...
|Installed plugin rest-client-builder-2.1.1
..............You currently already have a version of the plugin installed [rest-client-builder-2.1.1]. Do you want to downgrade to [rest-client-builder-1.0.3]? [y,n]
Now My question is why I am getting the message to downgrade to 1.0.3 in the same build?
I suspect this is linked to some strange errors (like unit test framework quitting expectedly which was not happening before the upgrade).
PS: When again putting 1.0.3 version back, I just get the message to downgrade. So I wonder whats wrong when I put the higher version.

I am not sure whether this will work for you or not but you can run grails depedency-report command and see if there is anything in there that it's needing the older version. If so upgrade that other plugin If that is not the case make sure you do not have any references in BuildConfig to 1.0.3. This is my BuildConfig:
plugins {
build(":release:3.0.1", ":rest-client-builder:2.1.1", ":tomcat:7.0.54") {
export = false
}
runtime ":console:1.5.4"
runtime ':db-reverse-engineer:0.5'
runtime ":hibernate:3.6.10.16"
compile ":scaffolding:2.0.3"
runtime ":jquery:1.11.1"
compile ":jquery-ui:1.10.4"
compile ":mail:1.0.7"
compile ":cache-headers:1.1.7"
compile ":rest-client-builder:2.1.1"
}
When I had that issue I realized i had the rest-client-builder:1.0.3 listed in the build section and in compile I had the 2.1.1. It was in front of my eyes and I would not see it.
You can also try to do a clean-all. Additionally, delete all the plugins from your .m2 folder at C:\Users\your_user\.m2\repository\org\grails\plugins\rest-client-builder
Then do a grails refresh-dependencies with just the 2.1.1 version in your BuildConfig. I am running grails version 2.3.11 For earlier than grails 2.3 you are stuck with the earlier version.

Related

Grails upgrade to 3.2 broke springsecurity with config type requestmap

After upgrading Grails from 3.1.8 to 3.2.4 the application was stuck in a redirection loop, always tried to redirect to /login/auth. Typical behaviour for missing requestmap entries. I have tried to upgrade hibernate4 as well, as described in the upgrade notes of grails 3.2
Original dependencies from working application with Grails 3.1.8
compile "org.grails.plugins:hibernate4"
compile "org.hibernate:hibernate-ehcache"
According to upgrade notes
compile "org.grails.plugins:hibernate4"
compile "org.hibernate:hibernate-core:4.3.10.Final"
compile "org.hibernate:hibernate-ehcache:4.3.10.Final"
but the application is still trapped in this redirection loop. I identified clearly the requestmaps as the root cause for the problem, because I deactivated this feature and switched to static rules. Are there any suggestion which dependencies to use for getting springsecurity plugin working with Grails 3.1.8?
Following springsecurity version is used:
compile 'org.grails.plugins:spring-security-core:3.1.1'
You may need to call springSecurityService.clearCachedRequestMaps()
See:
http://grails-plugins.github.io/grails-spring-security-core/v3/index.html#requestmap-cache

Grails Upgrade to 2.5.5 - Unresolved dependencies - groovy-all 2.4.5

I am trying to upgrade my grails application from 2.0.0 to 2.5.5, running into Unresolved dependencies for groovy-all jar.
Dependency resolver in BuildConfig.groovy is set to ivy. Also, location %USERPROFILE%/.grails/ivy-cache/org.codehaus.groovy contains groovy-all.jar of version 2.4.5
Java is set to JDK7
Exact error:
org.codehaus.groovy#groovy-all;2.4.5: configuration not found in org.codehaus.groovy#groovy-all;2.4.5: 'master'. It was required from org.grails#grails-core;2.5.5 compile
BuildConfig.groovy
grails.project.dependency.resolver = "ivy"
repositories {
mavenRepo "link to company specific repo"
mavenCentral()
}
plugins {
runtime ":hibernate4:4.3.10"
runtime ":jquery:1.7.1"
runtime ":resources:1.1.5"
runtime ":bubbling:1.5.1"
runtime ":calendar:1.2.1"
runtime ":code-coverage:1.1.6"
runtime ":jsecurity:0.3"
runtime ":tomcat:7.0.42"
runtime ":webflow:1.3.7"
runtime ":webtest:1.1.5.1"
runtime ":yui:2.8.2.1"
build ":tomcat:7.0.70"
}
Please help. Let me know if any additional details needed.
After spending lot of time finding reason for this issue, I came across an issue reported in Grails version 2.5.5 (https://github.com/grails/grails-core/issues/10011) So before going to my project, tried to execute basic grails command "grails-createapp". This command also failed with error mentioned in question above.
Solution in our case was to
1. Remove Grails version 2.5.5 (if this is already installed)
2. Download/install Grails version 2.5.4
3. Run basic command grails-createapp. This runs fine and an app is created.
4. Remove Grails version 2.5.4
5. Install Grails version 2.5.5 now
6. Run command - grails createapp (this starts working now)
Strange issue :)
For upgrade to version 2.5.5 add to your BuildConfig dependencies the line
compile 'org.codehaus.groovy:groovy-all:2.4.6'
This worked for me.

Grails GGTS "Task 'assemble' not found in root project" error when running "grails war" in Command Prompt

I have been learning Groovy/Grails Tool Suite (GGTS) 3.6.4, with Grails 2.4.4 using some video tutorials. When I attempt to package the project into an application using the grails war command on the Windows command prompt, I get the following error:
"Error Gradle build terminated with error: Task 'assemble' not found in root project ..."
Any references to this error that I have found online have only involved Android Studio (for instance), so I am at a loss here as to how to fix it for GGTS.
I have Android Studio 1.0.1 installed, and in case it was affecting the Grails packaging, I tried the solution of removing the <component name="FacetManager"> from the general Android Studio "MyApplication.iml" file, but that had no effect. I couldn't find any analogous file for the GGTS.
In case the issue lies elsewhere in my overall installation, I have Java JRE 7_79 (64-bit) installed, as well as the the JDK 1.7.0_79 (64-bit)
OK. I found out what the cause of the error was, and how to avoid it in the future.
The Problem
Grails 3.0.1 requires the following files for grails war to work:
build.gradle
gradle.properties
gradlew
gradlew.bat
\gradle (directory)
Grails 2.4.4 does not require any of the above files for making a WAR file.
GGTS 3.6.4 does not work with Grails 3.0.1, but it comes with and works fine with Grails 2.4.4.
The Solution
Copying the stated Gradle files & directory to a GGTS project folder fixed the problem. However, I wasn't satisfied with needing to do this manually or with a custom batch file for every project.
Looking deeper, it turns out that when working out compatibility issues between the Java 32-bit JRE existing on my system and the Java 64-bit JRE & SDK, Grails, and GGTS versions (there was a lot of fiddling to get things working), at one point I had set up my global variable to Grails to be directed at 3.0.1, and I failed to update it to Grails 2.4.4. Making this change has fixed the issue.
Explaining the Cause
When following this video series on installing a compatible set of Java, Grails, and GGTS, the instructor manually downloaded the latest version of Grails from the Grails site and then downloaded GGTS separately from its own site. Both of these were older versions than what I was working with.
In my case it turns out that, after setting up the Java SDK & Grails, the latest version of GGTS (3.6.4) did not work properly with the latest version of Grails (3.0.1). Fortunately the GGTS bundle came with an older version of Grails (2.4.4), and by referencing that, GGTS would work correctly. However, although I changed the IDE reference to Grails, I forgot to reset my environment variable ...
So GGTS was setting up the project for using Grails 2.4.4. However, when calling grails war, the command was using Grails 3.0.1! Apparently these two versions of Grails use different files for creating a WAR file, so GGTS was not setting up the project directories with the correct local files, and the packaging was failing.
Avoiding Future Occurrences
So, when using GGTS 3.6.4, make sure that all references to Grails point to Grails 2.4.4.
In general, if any GGTS bundle contains a version of Grails, you should have everything set up to use that version, even if it is old.

Grails application holder error

I am working in grails 2.4.0 and installed excel-import 1.0.0 plugin to the project. While compiling the project it is generating an error that could not resolve the class Application Holder. Please help.
I was having the same problem. You can get the version 1.0.1 of the plugin here https://github.com/jbarmash/grails-excel-import
Or if you prefer, add this url to the repositories section in BuildConfig.groovy
mavenRepo "http://maven.ala.org.au/repository/"
I found that this repository has the latest version of the plugin (at least it compiles with grails 2.4.4, real tests are yet to be made)
Then add this two entries to the plugins section
compile ":excel-import:1.0.1"
compile ":joda-time:1.5"
Upgrade your plugin to the latest 1.0.1 version. It was made 2.4.x compatible.

Issues with upgrade to Grails 2.2.0 using GGTS

Iā€™m trying to upgrade Grails to version 2.2.0. I used gvm and installed Grails 2.2.0. After this I changed my project in GGTS to use Grails version 2.2.0 and Groovy version 2.0.0. But when I finally tried to run the project, I got the following error:
Error occurred during initialization of VMError opening zip file or JAR manifest
missing : null
agent library failed to init: instrument
What is the problem?
We had the same problem.
This is due to eclipse saving old run configuration for the previous grails version.
Just remove old launch configuration and retry.
To remove old launch configuration :
go to Run\RunConfiguration\Grails
select all nodes and remove them.
I had the same problem when I started using Grails 2.2.0 - The solution Ian mentioned works, here is the link to the issue and resolution that occurred in my project
Grails 2.2.0 error
Added on 1/15/2013 Other suggestions based on 2.2.0/ivy cache issues
I am running on windows, a couple of things to try.
Based on your error message seems like the issue might be related to the Ivy cached, I would suggest cleaning that out using the clean command.
I would also go ahead and delete the Icy cache folders on your machine at \ivy-cache(after backing it up just in case)
Read grails documentation at http://grails.org/doc/2.0.0/guide/gettingStarted.html, refer to section 2.3 regarding Ivy cache ā€“ there might be issues running 2.x and 1.x grails projects side by side.
When install, I do not have to install groovy explicitly - I just install grails and that take care of the groovy code implicitly. Is that possible for you to do? To rule out dependency issues?
On my version of grails I have the groovy version showing up as 2.0.5 ā€“ I assume you meant grails 2.2.0 ā€“ can you ensure that you have a groovy version installed with is compatible with grails 2.2.0?
If possible try your code on a fresh device where grails has not been installed before. This is to rule out interference due to other existing issues
It's a known issue to do with the fact that the version of the springloaded reloading agent used by 2.2 (and 2.1.3) has a different name from that used by previous versions of Grails. There's a workaround in the bug report, or you can upgrade to a nightly build of GGTS which knows about the new name (as described in this bug report).
I am using GGTS 3.2 with Groovy compiler 2.1.1 on Windows XP.
Had imported a project from GGTS 3.1, upgraded compiler to 2.1.1 and got in mess, so
deleted the project and removed it from .grails cache, then re-created project from scratch. When it came to running the project I got the ivy error.
Removing the old launch configuration via Run->RunConfiguration...Grails fixed problem without switching to a night build of GGTS.
(BTW Deleting ivy-cache didn't help at all)

Resources