mulesoft-labs / raml-jaxrs-codegen

Tools to enable RAML-first development in JAX-RS projects
Other
40 stars 44 forks source link

Use a composite resource loader on RamlParser constructor. #14

Open apsegian opened 10 years ago

apsegian commented 10 years ago

Use a composite resource loader on RamlParser constructor in order to add the FileResourceLoader. It is needed for the include statements. By default the RamlValidationService and RamlDocumentBuilder use the DefaultResourceLoader, which initializes a CompositeResourceLoader including only the UrlResourceLoader and ClassPathResourceLoader. The problem is that when running the parser using the maven plugin the project /src/java/resources directory is not in the classpath of the maven build and the include statements cannot locate the files contained in /src/java/resources directory. The solution of that is to use the FileResourceLoader in addition with the other two loaders.