Questions tagged [grails-config]
33 questions
                    
                    12
                    
            votes
                
                5 answers
            
        How to tell Grails application which environment it is in?
I would like to load Environment specific configurations in my grails application so that depending on which JVM the grails application is running on, I can point to that environment specific urls. In my case, I have 4 different environments to work…
        
        Stealth
        
- 1,559
 - 4
 - 16
 - 34
 
                    11
                    
            votes
                
                2 answers
            
        How to get Grails application name within Config.groovy?
I want to include the Grails application name in some of my configuration settings in grails-app/Config.groovy.  I've tried many ways without success.  For example, if I have the following in my Config.groovy,
edu.appname1 =…
        
        Big Ed
        
- 1,056
 - 9
 - 20
 
                    10
                    
            votes
                
                1 answer
            
        Use of 'grails.logging.jul.usebridge' in grails config.groovy
I am a newbie for log4j and sl4j, I am using grails 2.0.4 and in config.groovy there is a line
grails.logging.jul.usebridge = false for prod
&
grails.logging.jul.usebridge = true for dev
I followed this article, As it says that use of…
        
        n92
        
- 7,424
 - 27
 - 93
 - 129
 
                    9
                    
            votes
                
                1 answer
            
        How to exclude grails global dependency
Grails has bouncycastle:bcprov-jdk14:138 as global dependency
+--- org.grails:grails-docs:2.3.3
|    \--- org.xhtmlrenderer:core-renderer:R8
|    \--- org.yaml:snakeyaml:1.8
|    \--- org.grails:grails-gdoc-engine:1.0.1
|    \---…
        
        Andrej Soroj
        
- 1,103
 - 1
 - 9
 - 10
 
                    7
                    
            votes
                
                2 answers
            
        how to get version 4.0 of httpclient off of my classpath in grails
I am using Grails 1.3.7 and cannot figure out how to get version 4.0 of httpclient off of my classpath (in favour of 4.1).  I need to do this because of a no-args constructer used in 4.1 that the plugin relies on.
Running a grails…
        
        Peter
        
- 29,498
 - 21
 - 89
 - 122
 
                    3
                    
            votes
                
                2 answers
            
        How to access grailsApplication and ApplicationContext in Functional Tests
I am building a Grails REST application and I have written my Functional Tests using Spock.
Note that these functional tests are for REST services only.
class LoginFunctionalSpec extends Specification {
  def setUp() {
    // here I want to access…
        
        shantanusinghal
        
- 714
 - 1
 - 8
 - 17
 
                    2
                    
            votes
                
                2 answers
            
        Quartz job triggering from Config.groovy
I have the following Quartz job running in my application:
class ScraperJob {
    def scraperService
    static triggers = {
        cron name: 'scraperTrigger', cronExpression: "0 0 * * * ?"  // run every minute
    }
    def execute(){
       …
        
        Alexandre Bourlier
        
- 3,972
 - 4
 - 44
 - 76
 
                    2
                    
            votes
                
                1 answer
            
        Is it possible to load more config files from an externalized config file in Grails?
Hypothetical situation:
I have downloaded a Grails application from the web as a WAR file, foo.war. In the documentation it says that I can put my own custom configuration in /foo.groovy, because this path is included in grails.config.locations in…
        
        haydenmuhl
        
- 5,998
 - 7
 - 27
 - 32
 
                    2
                    
            votes
                
                2 answers
            
        Grails app not picking up data from config
I have three environments blocks in my Grails config file similar to this:
environments {
    production {
        grails.serverURL = "https://www.mysite.com"
    }
    development {
        grails.serverURL = "http://localhost:8080/${appName}"
   …
        
        Slavko
        
- 486
 - 3
 - 6
 - 12
 
                    2
                    
            votes
                
                0 answers
            
        Could I override the grails.env during runtime
Grails seems to build the artefacts per env. 
with the command "grails -Dgrails.env=test war
Is it possible for me to override the running environment programmatically?
The issue here is that we produce the war file using production env config. But…
        
        ryang
        
- 151
 - 5
 
                    2
                    
            votes
                
                1 answer
            
        Programmatically detecting if an external config file has been read in?
We use grails.config.locations to pull in (optional) settings from a file external to the app. Is there a good way to detect that this file was loaded, either in Bootstrap.groovy or within Config.groovy itself?
Config.groovy has…
        
        Sean LeBlanc
        
- 185
 - 2
 - 12
 
                    2
                    
            votes
                
                0 answers
            
        Grails URL Mappings using name for multiple adress
I'm looking for good practice or a shorter way to write my "Named" Grails URL mapping. 
I'd like to write (especially to ease the internationalization process) this in UrlMappings.groovy:
            name…
        
        Smithfield
        
- 341
 - 4
 - 11
 
                    2
                    
            votes
                
                2 answers
            
        How to define properties of a Service Bean from application.yml in Grails 3?
I was able to define properties of a service bean from Config.groovy. 
Quoting Book The Definitive Guide to Grails 2
Listing 10-6. Configuring Beans Using Config.groovy
beans {
    albumArtService {
        artworkRequestUrl = 'http://itunes...'
 …
        
        Sergio del Amo
        
- 76,835
 - 68
 - 152
 - 179
 
                    2
                    
            votes
                
                1 answer
            
        Bean definition using Grails Spring DSL needs index/type/name arguments
In resources.groovy, I'm trying to define a bean named 'sql' which is a groovy.sql.Sql constructed using the dataSource defined by the application.
sql(groovy.sql.Sql, 'firstArgument', ref('dataSource') ) {}
Unfortunately this fails as follows…
        
        DetroitRockCity
        
- 51
 - 6
 
                    2
                    
            votes
                
                1 answer
            
        Why can't I get my logger to write to the file appender in Grails?
I have a controller and a service named ApiController and ApiService.groovy. I have my Config.groovy file setup to write the error and info logs to a file using an appender. When I call log.info("foo") in my service, it only writes to the STDOUT and…
        
        coderberry
        
- 3,040
 - 3
 - 26
 - 28