Skip to content

Commit

Permalink
update 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yeahbutstill committed Dec 11, 2023
1 parent f0521a1 commit 7a4bf63
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 16 deletions.
14 changes: 14 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
services:
postgres:
image: 'postgres:15-alpine'
environment:
- 'POSTGRES_DB=contact_management_db'
- 'POSTGRES_PASSWORD=dani'
- 'POSTGRES_USER=dani'
- 'PGDATA=/var/lib/postgresql/data/pgdata'
volumes:
- '$PWD/restful-api-contact-management-data:/var/lib/postgresql/data'
ports:
- '5432:5432'
expose:
- '5432'
91 changes: 76 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.3</version>
<version>3.2.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.yeahbutstill</groupId>
Expand All @@ -14,7 +14,8 @@
<name>contact-management-api</name>
<description>Demo project for Spring Boot RESTful API Contact Management</description>
<properties>
<java.version>17</java.version>
<java.version>21</java.version>
<spring-modulith.version>1.1.0</spring-modulith.version>
</properties>
<dependencies>
<dependency>
Expand All @@ -29,13 +30,31 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.modulith</groupId>
<artifactId>spring-modulith-starter-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.modulith</groupId>
<artifactId>spring-modulith-starter-jpa</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-docker-compose</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
Expand All @@ -61,6 +80,11 @@
<artifactId>spring-boot-testcontainers</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.modulith</groupId>
<artifactId>spring-modulith-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
Expand All @@ -71,22 +95,59 @@
<artifactId>postgresql</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.modulith</groupId>
<artifactId>spring-modulith-bom</artifactId>
<version>${spring-modulith.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
<groupId>io.github.deweyjose</groupId>
<artifactId>graphqlcodegen-maven-plugin</artifactId>
<version>1.50</version>
<executions>
<execution>
<id>dgs-codegen</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<schemaPaths>
<param>src/main/resources/graphql-client</param>
</schemaPaths>
<packageName>com.example.demo.codegen</packageName>
<addGeneratedAnnotation>true</addGeneratedAnnotation>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-dgs-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.hibernate.orm.tooling</groupId>
<artifactId>hibernate-enhance-maven-plugin</artifactId>
Expand Down Expand Up @@ -124,4 +185,4 @@
</plugins>
</build>

</project>
</project>
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ spring.datasource.hikari.minimum-idle=10
spring.datasource.hikari.maximum-pool-size=50
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.show_sql=true
spring.jpa.hibernate.ddl-auto=validate
spring.jpa.hibernate.ddl-auto=create-drop
23 changes: 23 additions & 0 deletions src/test/java/com/yeahbutstill/restful/TestDemoApplication.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.yeahbutstill.restful;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.utility.DockerImageName;

@TestConfiguration(proxyBeanMethods = false)
public class TestDemoApplication {

public static void main(String[] args) {
SpringApplication.from(ContactManagementApiApplication::main).with(TestDemoApplication.class).run(args);
}

@Bean
@ServiceConnection
PostgreSQLContainer<?> postgresContainer() {
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:15-alpine"));
}

}

0 comments on commit 7a4bf63

Please sign in to comment.