Files
mdm-ordinis/ordinis-app/pom.xml
T
Zimin A.N. 721607c246 fix(auth): explicit nimbus-jose-jwt в ordinis-auth — production crashloop
Найден production-bug на staging: ordinis-app в CrashLoopBackOff с
NoClassDefFoundError: com/nimbusds/jose/RemoteKeySourceException.

Причина: в Phase 2c e2e тестах я добавил nimbus-jose-jwt 9.37.3 как
test-scope direct dependency в ordinis-app/pom.xml. Maven scope
resolution: direct test-scope побеждает transitive compile-scope,
nimbus исключился из Spring Boot fat jar. На runtime
JwtDecoders.fromIssuerLocation() (использует Nimbus internally) падал.

Fix:
- ordinis-auth/pom.xml: explicit compile-scope dep на nimbus-jose-jwt
  (раньше тянулся транзитивно через oauth2-resource-server starter)
- ordinis-app/pom.xml: убрал test-scope direct decl, JwtTestSupport
  использует nimbus с compile classpath.

Verified: BOOT-INF/lib/nimbus-jose-jwt-9.37.3.jar в fat jar после rebuild.
e2e AuthE2ETest всё ещё зелёный (12/12).
2026-05-05 20:58:44 +03:00

168 lines
6.1 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cloud.nstart.terravault.ordinis</groupId>
<artifactId>ordinis-parent</artifactId>
<version>0.1.0-SNAPSHOT</version>
</parent>
<artifactId>ordinis-app</artifactId>
<name>Ordinis :: App (writer)</name>
<description>Spring Boot main для writer side: REST admin + outbox publisher + ЦУОД bundle.</description>
<dependencies>
<dependency>
<groupId>cloud.nstart.terravault.ordinis</groupId>
<artifactId>ordinis-rest-api</artifactId>
</dependency>
<dependency>
<groupId>cloud.nstart.terravault.ordinis</groupId>
<artifactId>ordinis-cuod-bundle</artifactId>
</dependency>
<!-- Cross-cutting -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
</dependency>
<!-- Observability — OpenTelemetry -->
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-spring-boot-starter</artifactId>
</dependency>
<!-- Config + Vault -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-vault-config</artifactId>
</dependency>
<!-- Migrations module — нужен на classpath для миграций при тесте,
в проде Liquibase запускается отдельным Job в k8s. -->
<dependency>
<groupId>cloud.nstart.terravault.ordinis</groupId>
<artifactId>ordinis-migrations</artifactId>
<scope>test</scope>
</dependency>
<!-- Test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<version>1.21.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
<version>1.21.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>kafka</artifactId>
<version>1.21.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<scope>test</scope>
</dependency>
<!-- nimbus-jose-jwt — на compile classpath через ordinis-auth.
Здесь не дублируем (тест-scope direct override compile-transitive
и nimbus не попадает в Spring Boot fat jar). -->
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- По умолчанию e2e тесты НЕ запускаются — нужны Postgres+Kafka
через Testcontainers (требует Docker). Включить через профиль
`-P e2e` (см. ниже). Локально: либо профиль, либо `-Dtest=*E2ETest`. -->
<excludes>
<exclude>**/e2e/*E2ETest.java</exclude>
</excludes>
<!-- Testcontainers требует DOCKER_HOST. На macOS Docker Desktop
socket в ~/.docker/run, не /var/run. ENV не наследуется в
forked surefire процесс по умолчанию — пробрасываем явно. -->
<environmentVariables>
<DOCKER_HOST>${env.DOCKER_HOST}</DOCKER_HOST>
<DOCKER_API_VERSION>1.45</DOCKER_API_VERSION>
<TESTCONTAINERS_RYUK_DISABLED>true</TESTCONTAINERS_RYUK_DISABLED>
<!-- Для CI с docker:dind service: указывает testcontainers
что spawned контейнеры доступны через `docker` hostname,
не localhost. Локально пусто → testcontainers default. -->
<TESTCONTAINERS_HOST_OVERRIDE>${env.TESTCONTAINERS_HOST_OVERRIDE}</TESTCONTAINERS_HOST_OVERRIDE>
</environmentVariables>
<systemPropertyVariables>
<api.version>1.45</api.version>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<!-- Включает e2e тесты (Testcontainers). Запускать на CI runner с DinD
либо локально с Docker Desktop. -->
<id>e2e</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes combine.self="override"/>
<includes>
<include>**/e2e/*E2ETest.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>