Description:
There is a need to use external JSON schema(s) to describe data in RAML API interfaces.
The schema is expected to reside inside a jar file which attached to a module as a regular dependency.
If the above is not achievable – propose any options of how external schemas can be used in a module with minimal effort
Results:
Include JSON schemas as a dependency to the module using maven plugins
Approach:
- add a dependency to the target module
- include following plugins to the .pom file
Expand | ||
---|---|---|
| ||
This plugin unpack the files of particular dependency
|
Expand | ||||
---|---|---|---|---|
| ||||
|
Expand | ||
---|---|---|
| ||
After the module builds, all references to files will point to exact files in the current system: which is not convenient to use in case of the different build environments. The following plugin task will replace found lines, specifying the path to file and cut it to leave only the file name.
|
Advantages:
- No need to modify RMB module
Disadvantages:
- Insert a bunch of plugins to every module needed
- maintain regex in case of change
2. Add
Useful links: