First, can you confirm… are you trying to write java code that parses springMVC annotated classes, and from that generate a RAML file? Or are you trying to do what I hope you are…which is the single-source-of-truth route with RAML being the single source of truth, generating SpringMVC classes?
If you are going the RAML to SpringMVC, I can assure you, after much speculation (just ask @christian_vogel and @blakeembrey) about whether or not the raml-client-generator project could handle this, that it can indeed quite easily and quickly be used to generate code. It does require a bit of understanding of both nodejs (and some slight functional JS but not much) and the Handlebars.js templating engine. But, after about two weeks of messing around (and some help from those two guys), I have been able to generate a consumable SDK in java, python and ruby, and I don’t know python and ruby very well. It’s far from done/ready, but it works against our deployed APIs that “match” the RAML definition I build. I even have json schema converting to java pojos (using jsonschema2pojo right now, but working on a pure handlebars.js template to do the same thing). I will first say that the ruby and python code I generate was a direct copy of the java template I built, with language specific changes. Over some time the templates would be a bit different so that each language would mimic what a developer of that language would expect, but otherwise, it works.
@blakeembrey put together a separate project, raml-generator, that is a little more capable in that you can (and will) customize the “starter” JS code for your specific API, possibly repurposing the initial one provided. I did that to spit out specific files for one template for example, as well as to handle conditions such as inlined schemas vs included schemas. It’s been quite some fun working on it, and I think raml-generator has improved a bit as a result.
I am with you on the “painful” side of things. I too tried it, then gave up and went back to RAML-2-JAXRS and started writing java code to generate java code. But I kept on thinking for each language, I will need a language expert (in the case of SDK generators for languages like python, go, ruby, .net, etc) and a RAML parser for those languages that works as well. The beauty of the raml-generator project is the engine parses the RAML and calls the templates with various aspects of the RAML file details, like the initial “root” context, individual resources, etc. In the end, having a roughly similar template that can be used with minor differences for each language seemed to make more sense. As well, this very same process could be used to replace the RAML-2-JAXRS project, the RAML2HTML project, and others. Anything you can think of, you can use this one project with some templates to generate output. HTML, PDF, language code, server side code, etc.
I’d be happy to help get you started so that @blakeembrey and @christian_vogel can focus on the 1.0 spec that is hopefully coming sooner than later. Shoot me a PM here, and we can get you started.