Where to put non-compiled resources that should be in classpath

37 views
Skip to first unread message

Aaron

unread,
Oct 22, 2015, 3:13:26 PM10/22/15
to Grails Dev Discuss
Upgrading to Grails 3.0.9 and wasn't sure where non-compiled items that need to be accessible via the classpath. I know the grails-app/conf directory isn't compiled anymore. Previously one trick was to put .groovy or .properties files in the src/java path as those items were just copied directly into the classes/ directory.

Is there a better place in Grails 3/Gradle world? Somewhere meant for that type of thing?

Thanks,
Aaron

Aaron

unread,
Oct 27, 2015, 1:28:16 PM10/27/15
to Grails Dev Discuss
To answer my own question, I think maybe:

src/main/resources
src/test/resources

Seem to be the 'gradle way' of adding things to the classpath. I moved my TestDataConfig.groovy there for build-test-data and it seemed to work. Still validating if that's a good spot for .properties files and the like.

-Aaron

Graeme Rocher

unread,
Oct 31, 2015, 8:19:25 AM10/31/15
to grails-de...@googlegroups.com
That is correct yes

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-disc...@googlegroups.com.
To post to this group, send email to grails-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/562a11e5-6761-4c37-9052-58eb23b66721%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aaron

unread,
Nov 5, 2015, 5:45:56 PM11/5/15
to Grails Dev Discuss
Actually, it looks like the stuff in grails-app/conf is automatically copied as-is to the build/resources/main directory (and included in the classpath).

-Aaron


On Saturday, October 31, 2015 at 8:19:25 AM UTC-4, Graeme Rocher wrote:
That is correct yes


On 27 Oct 2015, at 18:28, Aaron <lon...@gmail.com> wrote:

To answer my own question, I think maybe:

src/main/resources
src/test/resources

Seem to be the 'gradle way' of adding things to the classpath. I moved my TestDataConfig.groovy there for build-test-data and it seemed to work. Still validating if that's a good spot for .properties files and the like.

-Aaron

On Thursday, October 22, 2015 at 3:13:26 PM UTC-4, Aaron wrote:
Upgrading to Grails 3.0.9 and wasn't sure where non-compiled items that need to be accessible via the classpath. I know the grails-app/conf directory isn't compiled anymore. Previously one trick was to put .groovy or .properties files in the src/java path as those items were just copied directly into the classes/ directory.

Is there a better place in Grails 3/Gradle world? Somewhere meant for that type of thing?

Thanks,
Aaron

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-discuss+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages