I am currently struggling with writing a sbt plugin.
I released a BETA version here: https://github.com/oose/sbt-javaapi-gen
The purpose of the plugin is that I want to automatically create implicit classes around Java classes on the classpath, so that I can invoke getters and setters in scala style instead of writing it in java. Kind of the opposite of the bean property annotation.
Only after I tidied all the code I discovered that plugin code cannot access the project classpath and in order to analyse the configured java classes I do something like:
val clazzes = classes.map(className => JavaClass(Class.forName(className)))
That will of course fail as the sbt doc (only discovered afterwards) states:
Note: At runtime, all plugins for all builds are loaded in a separate, parent class loader of the class loaders for builds. This means that plugins will not see classes or resources from build definitions.
and as a current work around I need to define my dependencies in the project/build.sbt file as well, which is very annoying.
So - can I somehow change that? My actual plugin code can be found here:
and I tried to keep the sbt stuff seperate from the Generator itself.
P.S.: All answers are welcome, but please note that I am a total newbie with sbt internals.
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to