2

I need to get values from a groovy config file which named ( sth.properties ) so that i can set the values to an object properties ! file has for instance:

value1 = 1
value2 = 2
value3 = 3

and I need to set them to my object:

SomeObject.value1 = value1
SomeObject.value2 = value2
SomeObject.value3 = value3

I couldn't get this class which used to read groovy config files (ConfigSlurper) in my project. It seems like it is deprecated!

How can I do this?

jh314
  • 27,144
  • 16
  • 62
  • 82
Mich
  • 137
  • 3
  • 14
  • 2
    could you please provide the version of groovy you are using now, the version that used to work and provide at least a minimal example of the code you are using. – cfrick Mar 25 '15 at 12:36
  • am using it within gradle project 2.2 ! i just need a way to read the config file in my groovy service ! thnx – Mich Mar 25 '15 at 13:21
  • 1
    either read it as properties (http://stackoverflow.com/questions/8285595/reading-properties-file-in-java) or with ConfigSlurper (http://docs.groovy-lang.org/docs/next/html/documentation/#_configslurper); right now it looks like both could work – cfrick Mar 25 '15 at 13:33

0 Answers0