I just realised that the issue is due to a mapping error in the sample. However, this build error masks the actual error in hibernate mapping.
This means that enhancement plugin must first validate the mapping config before generating the code.