|
| 1 | += Generated Modules |
| 2 | +:toc: left |
| 3 | +:toc-title: Contents |
| 4 | +:toclevels: 2 |
| 5 | + |
| 6 | +Every module contains a full `src/` scaffold |
| 7 | +(`src/main/java`, `src/main/resources`, `src/test/java`, `src/test/resources`) |
| 8 | +and a `package-info.java` in every applicable leaf package directory. |
| 9 | + |
| 10 | +== Fixed Modules |
| 11 | + |
| 12 | +These modules are always generated regardless of input. |
| 13 | + |
| 14 | +`common-domain`:: |
| 15 | +Domain classes shared across all other modules. No dependencies on other generated modules. |
| 16 | ++ |
| 17 | +_Package_: `{base.package}.common.domain` |
| 18 | + |
| 19 | +`common-testing`:: |
| 20 | +Shared test utilities. Has no test-scope Java packages. |
| 21 | ++ |
| 22 | +_Package_: `{base.package}.common.testing` + |
| 23 | +_Depends on_: `common-domain` |
| 24 | + |
| 25 | +`service` _or_ `service-{name}`:: |
| 26 | +Business logic for a service area (see `singleService` and `serviceAreas` prompts). |
| 27 | ++ |
| 28 | +_Package_: `{base.package}.service` or `{base.package}.service.{name}` + |
| 29 | +_Depends on_: `common-domain` |
| 30 | + |
| 31 | +`app`:: |
| 32 | +Application assembly — produces the runnable artifact (e.g. Spring Boot über-jar). |
| 33 | ++ |
| 34 | +_Package_: `{base.package}.app` + |
| 35 | +_Depends on_: all non-test modules (`common-domain`, all domain and integration modules, |
| 36 | +all service modules, all presentation modules) |
| 37 | + |
| 38 | +`acceptance-tests`:: |
| 39 | +Functional acceptance tests that exercise the application from the outside. |
| 40 | +Has no main-scope Java packages. |
| 41 | ++ |
| 42 | +_Package_: `{base.package}.at` + |
| 43 | +_Depends on_: `app`, `common-domain`, all `domain-{type}-{name}` integration domain modules, |
| 44 | +all `domain-{type}` presentation domain modules + |
| 45 | +_Plugin_: `maven-failsafe-plugin` (`integration-test` + `verify` goals) |
| 46 | + |
| 47 | +== Integration Modules |
| 48 | + |
| 49 | +Generated per `type:name` pair in the `integrations` prompt. |
| 50 | +The `database` type is abbreviated to `db` in all names. |
| 51 | + |
| 52 | +`domain-{type}-{name}`:: |
| 53 | +Domain classes for a specific integration (e.g. `domain-db-users`, `domain-rest-orders`). |
| 54 | ++ |
| 55 | +_Package_: `{base.package}.domain.{type}.{name}` + |
| 56 | +_Depends on_: `common-domain` |
| 57 | + |
| 58 | +`integration-{type}-{name}`:: |
| 59 | +Integration implementation classes — DAOs, Spring Data JPA repositories, REST clients, etc. |
| 60 | +(e.g. `integration-db-users`, `integration-rest-orders`). |
| 61 | ++ |
| 62 | +_Package_: `{base.package}.integration.{type}.{name}` + |
| 63 | +_Depends on_: `common-domain`, `domain-{type}-{name}` + |
| 64 | +_Plugin_: `maven-failsafe-plugin` (`integration-test` + `verify` goals) |
| 65 | + |
| 66 | +== Presentation Modules |
| 67 | + |
| 68 | +Generated per type in the `presentationTypes` prompt. |
| 69 | + |
| 70 | +`domain-{type}`:: |
| 71 | +Domain classes for a presentation tier (e.g. `domain-rest`, `domain-graphql`). |
| 72 | ++ |
| 73 | +_Package_: `{base.package}.domain.{type}` + |
| 74 | +_Depends on_: `common-domain` |
| 75 | + |
| 76 | +`presentation-{type}`:: |
| 77 | +Request-handling classes — controllers, resolvers, etc. |
| 78 | +(e.g. `presentation-rest`, `presentation-graphql`). |
| 79 | ++ |
| 80 | +_Package_: `{base.package}.presentation.{type}` + |
| 81 | +_Depends on_: `common-domain`, `domain-{type}` |
| 82 | + |
| 83 | +== Parent POM |
| 84 | + |
| 85 | +`parent/pom.xml` is the aggregator and BOM for all sibling modules. |
| 86 | +There is no `pom.xml` at the project root — `parent/` is a sibling of all other modules. |
| 87 | + |
| 88 | +It contains: |
| 89 | + |
| 90 | +* `<packaging>pom</packaging>` |
| 91 | +* `<modules>` — all sibling modules referenced as `../module` relative paths, sorted alphabetically |
| 92 | +* `<dependencyManagement>` — all modules pinned to `${project.version}`, sorted alphabetically by `artifactId` |
| 93 | +* Common properties: Java 21 via `maven.compiler.release`; UTF-8 source encoding |
| 94 | +* `<pluginManagement>` — pinned versions for `maven-compiler-plugin`, `maven-failsafe-plugin`, |
| 95 | + `maven-jar-plugin` (with `skipIfEmpty=true`), and `maven-surefire-plugin` |
| 96 | + |
| 97 | +To build a generated project: |
| 98 | + |
| 99 | +[source,bash] |
| 100 | +---- |
| 101 | +cd my-service/parent |
| 102 | +mvn install |
| 103 | +---- |
| 104 | + |
| 105 | +== Package Reference |
| 106 | + |
| 107 | +All type and name segments in package names are lowercased. |
| 108 | + |
| 109 | +[cols="1,1"] |
| 110 | +|=== |
| 111 | +|Module |Package |
| 112 | + |
| 113 | +|`common-domain` |`{base.package}.common.domain` |
| 114 | +|`common-testing` |`{base.package}.common.testing` |
| 115 | +|`domain-{type}-{name}` |`{base.package}.domain.{type}.{name}` |
| 116 | +|`integration-{type}-{name}` |`{base.package}.integration.{type}.{name}` |
| 117 | +|`service` |`{base.package}.service` |
| 118 | +|`service-{name}` |`{base.package}.service.{name}` |
| 119 | +|`domain-{type}` |`{base.package}.domain.{type}` |
| 120 | +|`presentation-{type}` |`{base.package}.presentation.{type}` |
| 121 | +|`app` |`{base.package}.app` |
| 122 | +|`acceptance-tests` |`{base.package}.at` |
| 123 | +|=== |
0 commit comments