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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -