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,90 @@
|
||||
<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-swagger-ui</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,15 +115,74 @@
|
||||
<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>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
<goal>openapi</goal> <!-- Este goal genera openapi.json/yaml -->
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<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>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>*:*</artifact>
|
||||
<excludes>
|
||||
<!-- 1. GENÉRICO: Elimina TODO en META-INF excepto servicios y archivos ebean -->
|
||||
<exclude>META-INF/*.SF</exclude>
|
||||
<exclude>META-INF/*.DSA</exclude>
|
||||
<exclude>META-INF/*.RSA</exclude>
|
||||
<exclude>META-INF/MANIFEST.MF</exclude>
|
||||
<exclude>META-INF/DEPENDENCIES*</exclude>
|
||||
<exclude>META-INF/LICENSE*</exclude>
|
||||
<exclude>META-INF/NOTICE*</exclude>
|
||||
<exclude>META-INF/*.txt</exclude>
|
||||
<exclude>META-INF/*.md</exclude>
|
||||
|
||||
<!-- 2. ESPECÍFICO: Limpia los avisos de Netty, JSON Schema y Módulos -->
|
||||
<exclude>META-INF/io.netty.versions.properties</exclude>
|
||||
<exclude>draftv3/schema</exclude>
|
||||
<exclude>draftv4/schema</exclude>
|
||||
<exclude>**/module-info.class</exclude>
|
||||
<exclude>META-INF/versions/**</exclude>
|
||||
|
||||
<!-- 3. GENÉRICO: Archivos de licencia sueltos en la raíz -->
|
||||
<exclude>LICENSE*</exclude>
|
||||
<exclude>NOTICE*</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
<transformers>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/ebean.mf</resource>
|
||||
</transformer>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<mainClass>com.pablotj.portfolio.bootstrap.PortfolioApplication</mainClass>
|
||||
</transformer>
|
||||
</transformers>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
Reference in New Issue
Block a user