What is Archetype? In short, Archetype is a Maven project templating toolkit. An archetype is defined as an original pattern or model from which all other things of the same kind are made.
The karatetools-oss-archetype module povides the templates and scripts to generate karate-test modules.
This module has the following structure:
It includes the following files:
code/archetype/
├── pom.xml
└── src
├── main
│ └── resources
│ ├── META-INF
│ │ ├── archetype-post-generate.groovy (1)
│ │ └── maven
│ │ └── archetype-metadata.xml (2)
│ └── archetype-resources (3)
│ ├── .gitignore (4)
│ ├── .tool-versions (5)
│ ├── pom.xml (6)
│ └── src
│ └── test
│ ├── java
│ │ └── KarateRunnerTest.java (7)
│ └── resources
│ ├── config (8)
│ │ ├── db
│ │ │ ├── mariadb-config-local.yml
│ │ │ ├── mongodb-config-local.yml
│ │ │ └── postgresql-config-local.yml
│ │ ├── jms
│ │ │ └── activemq-config-local.yml
│ │ └── kafka
│ │ └── kafka-config-local.yml
│ ├── config-local.yml (9)
│ ├── config.yml (9)
│ ├── jwt
│ │ └── default-jwt.yml (10)
│ ├── karate-config.js (11)
│ ├── logback-test.xml (12)
│ └── mocks
│ └── templates
│ └── standalone (13)
│ └── .gitkeep
└── test
└── resources
└── projects (14)
├── all (15)
│ ├── archetype.properties (16)
│ ├── goal.txt (17)
│ └── reference (18)
│ ├── .gitignore
│ ├── .tool-versions
│ ├── pom.xml
│ └── ...
├── default (15)
│ ├── archetype.properties (16)
│ ├── goal.txt (17)
│ └── reference (18)
│ ├── .gitignore
│ ├── .tool-versions
│ ├── pom.xml
│ └── ...
...
| 1 | post-processing script to choose the files to include based on the archetype properties which are prompted to the user. |
| 2 | archetype descriptor, metadata defining the archetype properties, files and directories, and the post-processing script. |
| 3 | the prototype files that are copied by the archetype plugin to the target module |
| 4 | prototype: Git ignore file |
| 5 | prototype: Tools version manager file |
| 6 | prototype: Karate pom file |
| 7 | prototype: Java Test Runner |
| 8 | prototype: karate clients configuration files templates |
| 9 | prototype: Configuration Files (general and environment specific) |
| 10 | prototype: Karate Authentication Default JWT |
| 11 | prototype: Karate-config file |
| 12 | prototype: logback configuration file |
| 13 | prototype: karate mocks folder to define standalone mock templates |
| 14 | test projects to test the archetype generation with different configurations |
| 15 | test: project folder |
| 16 | test: archetype properties (groupId, artifactId, version, …) |
| 17 | test: maven goal to be executed for the project test, for example: clean validate |
| 18 | test: expected output files |
| Any changes made in the prototype files and/or processing scripts must be reflected in the corresponding output project tests. |