Yeap, the latter one.
As I remember there was an option to start jboss right by downloading itself from an (remote) repository (i.e. subversion), but I can't remember that option.
All I know is that we did it ones two or three years ago. I would recommend to investigate in that direction.
I've seen both methods in use. Very large sites seems to prefer a templating approach, while smaller ones are happy putting their configs under version control.