Add the hexagonal module: Hexagonal Architecture (Ports and Adapters) in Spring Boot 4

This commit is contained in:
Claude
2026-10-03 20:28:16 +00:00
parent ae681f85c4
commit fd6d0fa1e7
33 changed files with 1297 additions and 2 deletions
+47
View File
@@ -0,0 +1,47 @@
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.ankurm</groupId>
<artifactId>hexagonal-parent</artifactId>
<version>1.0</version>
</parent>
<artifactId>hexagonal-persistence-adapter</artifactId>
<packaging>jar</packaging>
<!-- This is the only module allowed to know a database exists. It depends on hexagonal-core
to implement WalletRepository, and on Spring Data JPA to do so for real. -->
<dependencies>
<dependency>
<groupId>com.ankurm</groupId>
<artifactId>hexagonal-core</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- Spring Boot 4 split @DataJpaTest out of spring-boot-test-autoconfigure into its own
artifact, alongside the rest of the data/jpa/web slices. Confirmed by unzipping
spring-boot-test-autoconfigure-4.1.1.jar (no "jpa" class anywhere in it) and then
spring-boot-data-jpa-test-4.1.1.jar, which has
org.springframework.boot.data.jpa.test.autoconfigure.DataJpaTest - a new package too,
not the old org.springframework.boot.test.autoconfigure.orm.jpa. -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-data-jpa-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>