Skip to content

Commit

Permalink
chore(spring) reorganize in maven module
Browse files Browse the repository at this point in the history
  • Loading branch information
mpumd committed Oct 8, 2024
1 parent ba0d773 commit 61aa49c
Show file tree
Hide file tree
Showing 8 changed files with 170 additions and 66 deletions.
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
# poc-person

## url acces
This project is just a poc to show :
- DDD approch on a functional entity named person with best practices,
- Context approch, aggregat, repository, event, command, query (CQRS vocabulary),
- BDD testing on the domain by the application layer,
- hexagonal architecture,
- spring, quarkus, others ?
- in :
- rest, soap, grpc, graphql and reactive/stream with reader model,
- kafka/jms consumer,
- out :
- jpa(postgre, oracle, sqlserver),
- nosql (mongodb, elasticsearch) with a reader model
- client (rest, soap),
- kafka/jms producer
- security OIDC, SAML, bearer.
- java native compilation with graalvm,

# spring boot
```bash
mvn -T 1C clean install -DskipTests && mvn spring-boot:run -pl infra-spring/sb-bootstrap/
```

## url acces
- http://localhost:8090/spring/api-docs
- http://localhost:8090/spring/swagger-ui/index.html
- http://localhost:8090/spring/swagger-ui
- http://localhost:8090/spring/actuator
- http://localhost:8090/spring/admin
98 changes: 36 additions & 62 deletions infra-spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,53 @@
<groupId>com.mpumd.poc</groupId>
<artifactId>infra-spring</artifactId>
<version>1.0-SNAPSHOT</version>
<!-- <packaging>pom</packaging>-->
<!-- <name>infra-spring</name>-->
<packaging>pom</packaging>

<description>Spring Boot application using in the person context</description>

<modules>
<module>sb-bootstrap</module>
<module>sb-in-rest</module>
<module>sb-out-jpa</module>
</modules>

<properties>
<java.version>22</java.version>

<springdoc-openapi-starter.version>2.6.0</springdoc-openapi-starter.version>
<spring-boot.version>3.3.4</spring-boot.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-dependencies</artifactId>
<version>${project.parent.version}</version>
<type>pom</type>
<version>${spring-boot.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>

<dependency> <!-- openapi -->
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
<version>${springdoc-openapi-starter.version}</version>
</dependency>
<dependency> <!-- swagger -->
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>${springdoc-openapi-starter.version}</version>
</dependency>

<dependency>
<groupId>com.mpumd.poc</groupId>
<artifactId>sb-in-rest</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.mpumd.poc</groupId>
<artifactId>sb-out-jpa</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down Expand Up @@ -61,69 +93,11 @@
<optional>true</optional>
</dependency>

<!--##### Run #####-->
<dependency>
<groupId>com.mpumd.poc</groupId>
<artifactId>application</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency> <!-- openapi -->
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
<version>${springdoc-openapi-starter.version}</version>
</dependency>
<dependency> <!-- swagger -->
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>${springdoc-openapi-starter.version}</version>
</dependency>

<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-server</artifactId>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-security</artifactId>-->
<!-- </dependency>-->


<!--##### Test #####-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>

</project>
60 changes: 60 additions & 0 deletions infra-spring/sb-bootstrap/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.mpumd.poc</groupId>
<artifactId>infra-spring</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>sb-bootstrap</artifactId>

<dependencies>
<dependency>
<groupId>com.mpumd.poc</groupId>
<artifactId>sb-in-rest</artifactId>
</dependency>
<dependency>
<groupId>com.mpumd.poc</groupId>
<artifactId>sb-out-jpa</artifactId>
</dependency>

<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-server</artifactId>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
</dependency>

<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-security</artifactId>-->
<!-- </dependency>-->
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mpumd.poc.person.spring;
package com.mpumd.poc.person.sb;

import com.mpumd.poc.person.application.PersonApplicationService;
import com.mpumd.poc.person.context.PersonPersistanceRepository;
Expand Down
35 changes: 35 additions & 0 deletions infra-spring/sb-in-rest/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.mpumd.poc</groupId>
<artifactId>infra-spring</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>sb-in-rest</artifactId>

<dependencies>
<!--##### Run #####-->
<dependency>
<groupId>com.mpumd.poc</groupId>
<artifactId>application</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency> <!-- openapi -->
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
</dependency>
<dependency> <!-- swagger -->
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mpumd.poc.person.spring.exposition.rest;
package com.mpumd.poc.person.sb.rest;

import com.mpumd.poc.person.application.PersonApplicationService;
import com.mpumd.poc.person.context.command.PersonRegistrationCommand;
Expand Down
14 changes: 14 additions & 0 deletions infra-spring/sb-out-jpa/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.mpumd.poc</groupId>
<artifactId>infra-spring</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>sb-out-jpa</artifactId>

</project>

0 comments on commit 61aa49c

Please sign in to comment.