I am using a GroovyClassLoader in my Java class to parse a certain (ideally complex) groovy file (to be executed in the next step):
Call in MyClass.java
final Class parsedClass = groovyClassLoader.parseClass(groovyFile);
Knowing that:
- Groovy files need to be stored in the filesystem because would need to be change without redeployment.
- This groovy file would need several imports:
GroovyFile.groovy imports
import com.my.import.one.Import1DTO
import com.my.import.two.Import2DTO
import com.my.import.three.Import3DTO
import com.my.import.four.Import4DTO
import com.my.import.five.Import5DTO
When the parseClass method is invoked, this exeception raises:
Exceptions
unable to resolve class com.my.import.one.Import1DTO;
unable to resolve class com.my.import.two.Import2DTO;
unable to resolve class com.my.import.three.Import3DTO;
unable to resolve class com.my.import.four.Import4DTO;
unable to resolve class com.my.import.five.Import5DTO;
Can I obtain the behaviour I expect without parse every import class before parse the base class?
Thanks!