refactor: replace Spring Boot with Jooby framework
- Remove Spring Boot dependencies and annotations. - Implement Jooby MVC controllers and Guice dependency injection. - Migrate persistence layer to Ebean ORM. - Configure Flyway migrations and ApiErrorController. - Update application configuration to HOCON format.
This commit is contained in:
@@ -1,12 +1,22 @@
|
||||
<project>
|
||||
<?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.pablotj</groupId>
|
||||
<artifactId>portfolio-api</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>bootstrap</artifactId>
|
||||
|
||||
<properties>
|
||||
<jooby.version>3.6.1</jooby.version>
|
||||
<postgresql.version>42.7.2</postgresql.version>
|
||||
<testcontainers.version>1.19.7</testcontainers.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.pablotj</groupId>
|
||||
@@ -14,40 +24,84 @@
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Drivers DB -->
|
||||
<dependency>
|
||||
<groupId>io.jooby</groupId>
|
||||
<artifactId>jooby-netty</artifactId>
|
||||
<version>${jooby.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.jooby</groupId>
|
||||
<artifactId>jooby-jackson</artifactId>
|
||||
<version>${jooby.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.jooby</groupId>
|
||||
<artifactId>jooby-jackson</artifactId>
|
||||
<version>3.6.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.jooby</groupId>
|
||||
<artifactId>jooby-hibernate-validator</artifactId>
|
||||
<version>3.6.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.jooby</groupId>
|
||||
<artifactId>jooby-openapi</artifactId>
|
||||
<version>${jooby.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.jooby</groupId>
|
||||
<artifactId>jooby-logback</artifactId>
|
||||
<version>${jooby.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<scope>runtime</scope>
|
||||
<version>${postgresql.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<scope>runtime</scope>
|
||||
<version>2.2.224</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger/OpenAPI -->
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||
<version>${springdoc.version}</version>
|
||||
<groupId>io.jooby</groupId>
|
||||
<artifactId>jooby-hikari</artifactId>
|
||||
<version>${jooby.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
<groupId>io.jooby</groupId>
|
||||
<artifactId>jooby-guice</artifactId>
|
||||
<version>${jooby.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Test -->
|
||||
<!--
|
||||
install(new DotenvModule());
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<groupId>io.jooby</groupId>
|
||||
<artifactId>jooby-dotenv</artifactId>
|
||||
<version>${jooby.version}</version>
|
||||
</dependency>-->
|
||||
<dependency>
|
||||
<groupId>io.jooby</groupId>
|
||||
<artifactId>jooby-flyway</artifactId>
|
||||
<version>${jooby.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.jooby</groupId>
|
||||
<artifactId>jooby-test</artifactId>
|
||||
<version>${jooby.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.testcontainers</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>${testcontainers.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
@@ -55,13 +109,34 @@
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<groupId>io.jooby</groupId>
|
||||
<artifactId>jooby-maven-plugin</artifactId>
|
||||
<version>${jooby.version}</version>
|
||||
<configuration>
|
||||
<mainClass>com.pablotj.portfolio.bootstrap.PortfolioApplication</mainClass>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.5.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>jooby-shade</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
<transformers>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<mainClass>com.pablotj.portfolio.bootstrap.PortfolioApplication</mainClass>
|
||||
</transformer>
|
||||
</transformers>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
Reference in New Issue
Block a user