Patching parts of a file with content that has been generated from the models.

Parent

The files to replace generated files are placed within the patch/files folder insider the project-models folder. You need to create the exact directory structure.

The fragment to patch a given file needs to be placed inside a folder with the name of that file. The patch file containing the fragment is named after the identifier of the generated file part it has to replace.

Marker example (XML)
<!-- insert-mark ID# -->
Marker example (JavaScript)
/* insert-mark ID# */

Before the file patched it is copied to target/backup (again creating the directory structure). This ways changes to the model or generation process can be checked with the patched files.

 

The directory layout with patch files for patching looks like this.

Parts of the files atlassian-plugin.xml and blueprint.js will be replaced with the fragments found in the files contained in the respective directory.

The patched content will be marked with the label PATCHED!.

 

There is only support to replace content generated by the generation process and only with JavaScript and XML files. All other files need to be replaced in whole.

If you need to patch other content, you need to apply other tools (for instance Maven XML Plugin or Maven Patch Plugin) as part of your build process after the project has been generated.