java - Import external (not compiled) groovy classes and keep them outside the jar -
i created groovy project in eclipse. build executable jar, keeping of groovy file sources outside jar, can modified , reloaded @ runtime.
i know can using groovyscriptengine:
class modelclass = new groovyscriptengine( "path_to_file" ).loadscriptbyname( "model.groovy" ) ; object modelinstance = modelclass.newinstance() ;
now, question is: possible simply, instance inside main class, use:
import model class main { static void main(string[] args) { model model = new model(args) ... }
i hope question clear enough... , thank help!
if jar in context of groovy, can add classpath folder groovy files(classes). groovy classloader compiles them automatically on access.
otherwise create groovy engine, add classpath directory groovy files..
Comments
Post a Comment