grails3 - What classspath is used for executing Grails' application.groovy -


what classspath used compiling/executing grails' application.groovy?

in application.groovy, instantiate custom class (contained in dependency's jar) , assign 1 of config properties, so:

environments {     production {         configproperty = new com.example.customclass() 

i upgraded application grails 3.1.5 3.2.2, , no longer works.

i receive error following when try run grails run-app:

error occurred running grails cli: startup failed: script14788250424471597489853.groovy: 43: unable resolve class com.example.customclass  @ line 43, column 33.         configproperty = new com.example.customclass() 

(notice code in production block, i'm running in development (run-app). makes me think it's compilation of script failing.)

so i'm guessing need add dependency (that contains customclass) appropriate classpath, i'm not sure one.

i'm using gradle, , have following in build.gradle file, pull in dependency containing customclass:

buildscript {     dependencies {         classpath "com.example:custom-module:1.1" // ... dependencies {     compile group: 'com.example', name: 'custom-module', version:'1.1' } 

the grails-app/conf/application.groovy file shouldn't reference application classes because read before compilation. if wish reference application classes in configuration please use grails-app/conf/runtime.groovy


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -