grails-plugin,grails-3.0 , Grails 3.0 adding an inlace plugin

Grails 3.0 adding an inlace plugin


Tag: grails-plugin,grails-3.0

I created simple grails 3.0 applications using commands below:

  1. create-app admin --profile=web
  2. create-plugin core --profile=plugin

Now, I wanted to use core as inlace plugin in admin build which is a web application.

We can easily do that in grails version < 3.0 in buildconfig. Where can I do that in grails 3.0. Every help is worth appreciated.


Inplace plugins have been replaced by multi project Gradle builds. See the Grails 3 functional test suite for an example


how can I disable reloading in a grails 3.0.0 app?

It appears that the spring reloading causes errors with JDK 8u40 in Grails 3.0.0.M2. Can I disable the reloading in development mode? Is there a key to set in the build.gradle or in the application.yml?

Grails-Camel Plugin won't install or run

Please note: Although this question involves a lib called Apache Camel I really think this is just a question about how modern Grails plugins work. I am on Grails 2.4.2 here, and I am trying to use Apache Camel with Grails and found the Grails Routing plugin annd cannot even...

grails behind a proxy / redirected to https

I got an grails application created behind a proxy a few month ago (all worked fine i.e. the initial load of all dependencys via the proxy). Now I want to add some new plugins to it, and some other people should also bring the app up and running on their...

Storing Spring Boot users in a database with Grails 3.0

How do you store users in a database with a new plain vanilla Grails 3.0 application? Background: The Shiro and Spring Security plugins are not yet available for Grails 3.0 (and it sounds like Spring Boot is the future for Grails security). There are various examples out there showing how...

Grails Url shortener plugin not getting installed

I am trying to add a new plugin mentioned here in my app but it is not been resolved and giving me a error i.e. :: problems summary :: :::: WARNINGS module not found: org.grails.plugins#url-shortener;0.2.1 ==== grailsPlugins: tried -- artifact org.grails.plugins#url-shortener;0.2.1! ... ==== grailsHome: tried /opt/grails/lib/org.grails.plugins/url-shortener/ivy-0.2.1.xml -- artifact org.grails.plugins#url-shortener;0.2.1! /opt/grails/lib/org.grails.plugins/url-shortener/jars/

Grails 2.2.1 app cannot resolve dependencies

I am running into problems setting up an existing grails (2.2.1) project on a new mbp. I get dependency resolution errors whenever I try to run any grails command. It seems that it cannot resolve any grails plugins that are marked with the compile phase like below. compile ":cache:1.0.0" I've...

Grails 3: what is replacement for eventCreateWarStart in _Events.groovy

I am migrating a plugin from Grails 2.4 to Grails 3. I am facing to the following issue. I tried to use eventCreateWarStart in _Events.groovy. Like we used to compile widgetset in our plugin's _Events.groovy file. But it seems this approach is not allowed in Grails 3. I went through...

Grails mocking method in service which uses rest plugin

I'm very new to Grails but have been using Ruby on Rails for the past few months, I can't seem to get my head around how to correctly Mock some functionality within a Service I have so I can properly Unit Test it. I have a RestService which uses a...

Grails Render PDF Plugin returns NullPointerException

I'm trying to render a pdf file with render plugin. My controller code is: def toPDF(){ DomainClass domainClass = DomainClass.get( try{ renderPdf(template: "/domainClass/pdf", model: [domain: domainClass], filename: System.currentTimeMillis().toString() + "_" + + ".pdf") }catch(e){ redirect action: "error" } } In development mode, it works properly. But in production, this...

Where to place resources in Grails 3 project?

This answer addresses this problem for a Grails 2 project, but does not work for a Grails 3 project. For instance, in a Grails 2 project I was able to put an xsl file in /src/groovy/myapp/resources/ and load it similar to what the linked answer suggested... this.class.getClassLoader().getResourceAsStream("myapp/resources/my_xsl.xsl") // Returns an...

Getting Application Configuration in doWithSpring Colsure of Plugin Descriptor

I am extending the Spring oauth Plugin and want to declare beans for some Classes I extended like the OAuthConfig class, I want to declare the extended class as a bean in the doWithSpring closure of the plugin Descriptor public class MyOAuthConfig extends org.scribe.model.OAuthConfig { public MyOAuthConfig(String key, String secret)...

Grails 3.0 adding an inlace plugin

I created simple grails 3.0 applications using commands below: create-app admin --profile=web create-plugin core --profile=plugin Now, I wanted to use core as inlace plugin in admin build which is a web application. We can easily do that in grails version < 3.0 in buildconfig. Where can I do that in...

Configuring Spring Boot Security to use BCrypt password encoding in Grails 3.0

In Grails 3.0, how do you specify that Spring Boot Security should use BCrypt for password encoding? The following lines should provide a sense of what I think needs to be done (but I'm mostly just guessing): import import PasswordEncoder passwordEncoder passwordEncoder(BCryptPasswordEncoder) My application loads spring-boot-starter-security as a...

Grails 3.0.0.M1 - create-plugin - Could not find method bintray

In the frustration, that I am not able to add a filter and mapping to the gone web.xml I wanted to create a plugin, only to be able to use doWithWebDescriptor() (My first plugin for my first application) I am not good enough to discern, if the following is worth...

Using grails datasources in quartz plugin

I want to create quartz jobs that use a JdbcStore as described in the clustering section of the docs, in Burt's example. The example shows how to configure quartz using a file. Now, I'd like my jdbc store to be the same database as my grails application, so that...

Class Not Found errors when upgrading grails to 2.5.0 for Grails database migrations files

I am trying to upgrade Grails app from 2.4.3 to 2.5.0 version. Grails 2.5.0 contains fixes and improvements but doesn't have any breaking changes. Also, installed all 2.5.0 compatible plugin versions. Also gone through Grails Database Migration Plugin changelog and other plugin to support grails 2.5.0. Come across same JIRA...

Accessing images from grails in-line plugin when deployed in a tomcat server

I have two grails applications and created an inline plugin named cmcore. I placed some images in cmcore/web-app/images so that both of my applications have access on the said images. Images are successfully accessed by both applications in development environment but whenever I build WAR files of my applications in...

Prevent Grails Asset-Pipeline from changing File Name?

I use Grails 2.4.4 and the asset-pipeline plugin. One of my assets is a PDF file. I want that the name someName.pdf while remain when a user downloads this file. In my GSP I use it as: <a href="${assetPath(src: 'someName.pdf', absolute:true)}" target="_blank">Download PDF</a> When I run in production the downloaded...

Error Failed to resolve dependencies grails

I get Error Failed to resolve dependencies error when I try to run, clean, or compile. My BuildConfig.groovy file is as follows: grails.servlet.version = "2.5" // Change depending on target container compliance (2.5 or 3.0) grails.project.class.dir = "target/classes" grails.project.test.class.dir = "target/test-classes" grails.project.test.reports.dir = "target/test-reports" = 1.6 grails.project.source.level = 1.6...

3.0.0.M1 how to run on https connection

Trying Grails 3.0.0.M1, a lot has changed! How would I run-app --https and how would I configure it that way also for the production-environment-war? Many thanks!...

Unable to run Application.groovy from IntelliJ IDEA

I have a new grails 3 project that I created using the grails create-app command. When I try to run Application.main() from IntelliJ IDEA I get the following error Exception in thread "main" java.lang.ExceptionInInitializerError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName( at com.intellij.rt.execution.application.AppMain.main( Caused by: java.lang.NullPointerException at at...

Grails 2.3.9 - Error: ClassNotFoundException: grails.plugin.spock.test.GrailsSpecTestType

Whenever I enter the grails command: test-app I get this error: Error executing script TestApp: java.lang.ClassNotFoundException: grails.plugin.spock.test.GrailsSpecTestType (Use --stacktrace to see the full trace) In my BuildConfig.groovy I have: grails.project.dependency.resolution = { ... plugins { ... test ":spock:0.7" } } I've tried replacing it with compile ":spock:0.7" . I've also...

Recommended approach to multi-threading in Grails 3

In Grails 2 I used the Executor plugin to perform multi-threading operations in services and it worked very well. Like most Grails plugins it hasn't been ported over to Grails 3 yet. The GPars library is/was another option for multi-threading, but with Codehaus shutdown I am reluctant to use it....

convert configuration file application.yml to application.groovy in Grails 3.x

I am trying to create a simple Grails 3 project and got stuck with something really simple. So I want my data source properties to come from VM options that I set in my IntelliJ IDE. Before in Grails 2.x, I just used to do something like: environments { development{...

How to get Authenticated with spring security rest plugin in Grails

I'm using Grails version 2.4.3 . I am creating an application that supports RESTful APIs. Since access to these APIs should be authenticated , I tried out the Spring Security REST plugin. I checked out this example and what I could understand is , the /api/login controller is the authentication...

How does one add mongodb and/or postgresql-extension plugins to Grails 3.0.0+?

I played with Grails 3.0.0.M1 today and tried to make a small application using mongodb, however I couldn't manage to add it correctly to my build.gradle file. What is the correct syntax? I tried (excerpt): repositories { mavenLocal() maven { url "" } } dependencyManagement { imports { mavenBom "org.grails:grails-bom:$grailsVersion"...

How to declare javascript asset in the view to be rendered within the footer using Grails Asset Pipeline

Since there is no deferred option for: <asset:javascript src="custom_view_script.js"/> What else can be used, outside of resource plugin, to place view specific script right before the closing body tag and without declaring it globally in layout? I do know about: <asset:deferredScripts/> but that only handles on page script and not...

Grails filter disables style/css

I made a security filter, following the book "Beginning Grails, Groovy and Griffon". Looks like the functionality works ok, but, for some reason, the only page that the filter allows to open without a logged in user, is lacking any style. Just textfields, labels and buttons. Also the simple capthca...

Grails 3.0.0M1 - running war standalone - no main class in MANIFEST.MF

Grails 3: Trying the example from the docs to run the war file standalone: $ java -Xmx768M -XX:MaxPermSize=256m -jar test-0.1.war Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0 no main manifest attribute, in test-0.1.war So which is the main class I must start? Thanks...

Creating a Google Login using Grails

I'm trying to create a Google Login option in a Grails project. I'm new to Grails and am using version 2.4.4 as this was the latest at the time of installing. After much searching of the Grails Plugins I've added the last 4 lines to my BuildConfig.groovy file: plugins {...

Sorting on nullable fields in GORM

I'm trying to figure out how to sort on multiple fields in Grails 3, one of which may or may not be null. I have this Book domain: class Book { String title String sortTitle static constraints = { title blank: false sortTitle nullable: true } } Books with titles...

Decompression of GZIP:ed response (Grails / Groovy)

I'm consuming a REST api using the RestBuilder plugin. I get a response where the body is compressed: Content-Encoding=[gzip] Does groovy/Grails provide any easy access / native methods for decoding gzip compression? The only thing I found is the native Java zip api (ex. GZIPInputStream). Does someone have a better...

Authentication using Grails Spring Security REST Plugin

I came across the Greach 2014 presentation of Alvaro. I downloaded the example from GitHub and started it. When I try to authenticate with curl -i -H "Content-Type: application/json" -X POST -d '{"username":"jimi","password":"jimispassword"}' http://localhost:8080/restful-grails-springsecurity-greach2014/api/login I am getting this on the curl side. HTTP/1.1 400 Bad Request Server: Apache-Coyote/1.1 Content-Length: 0...

Grails Controller and URL Mapping Magic

Grails 3.0.1 here. I'm looking to accomplish a specific URL/controller structure. My app deploys at the root context (/), meaning locally it runs as http://localhost:8080, and non-locally as I want everything under /app/* to be authenticated and considered to be part of the "core app" (requires login). Anything outside...

Redirect Loop with Requestmap with grails spring security core 2.0RC4

I have been facing Failed to load resource: net::ERR_TOO_MANY_REDIRECTS with grails 2.4.4. I have User, Role and Requestmap in com.usermanagement.auth package(those were generated with s2-quickstart). Requestmaps, users and roles seem to be stored in the database(I am using mysql). BuildConfig.groovy compile ":spring-security-core:2.0-RC4" Bootstrap.groovy on init method User admin = new...