Skip to content

Extract multi-tenancy into spring-services-tenant module (spec 016)#35

Merged
hendrikebbers merged 5 commits into
mainfrom
feat/016-tenant-feature-module
Jul 16, 2026
Merged

Extract multi-tenancy into spring-services-tenant module (spec 016)#35
hendrikebbers merged 5 commits into
mainfrom
feat/016-tenant-feature-module

Conversation

@herbie-bot

Copy link
Copy Markdown
Collaborator

Summary

Extracts the com.openelements.spring.base.tenant package out of spring-services-core into a new optional feature module spring-services-tenant, consistent with the spec-014 module pattern. Consumers that don't use multi-tenancy no longer carry its abstractions; the feature self-activates on classpath presence. Build-coordinate change only — no API, schema, or runtime-behaviour change to the tenancy logic.

Spec

  • Spec folder: docs/specs/016-tenant-feature-module/
  • Design: docs/specs/016-tenant-feature-module/design.md
  • Behaviors: docs/specs/016-tenant-feature-module/behaviors.md

Changes

  • New spring-services-tenant module (depends on core; PomChecker-compliant <url>); wired into the reactor, spring-services-all, and the BOM.
  • TenantAutoConfiguration (@Import(TenantConfig)) self-activates via AutoConfiguration.imports; no @ConditionalOnClass (no third-party dep).
  • TenantConfig drops @ComponentScan and registers TenantService as an explicit @Bean (service loses @Service/@Autowired) → co-located auto-config is not double-registered.
  • Core cleanup: FullSpringServiceConfig no longer @Imports TenantConfig; the data/package-info tenant {@link} becomes plain text so core Javadoc stays clean under failOnWarnings.
  • @EnableTenant / @Import(TenantConfig) still work.

Test coverage

  • TenantServiceTest moved unchanged (tenancy behavior) + new TenantAutoConfigurationTest (self-activation, single bean / no double registration). 5 tests.
  • Full -Pfull-build clean verify -Dmaven.javadoc.failOnWarnings=true green across all 11 modules (0 javadoc warnings; core compiles/Javadocs clean without tenant).
  • spec-review + quality-review clean.

Note

Breaking for à-la-carte consumers who used tenant types via spring-services-core directly — they add spring-services-tenant (or use spring-services-all, unchanged). Documented in docs/releases/upgrade-to-1.4.md.

Closes #34

🤖 Generated with Claude Code

hendrikebbers and others added 5 commits July 15, 2026 23:08
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Spec 016. Moves the com.openelements.spring.base.tenant package out of
spring-services-core into a new optional feature module spring-services-tenant
(depends on core), registered in the reactor, spring-services-all and the BOM.

- TenantAutoConfiguration (@import(TenantConfig)) self-activates on classpath
  presence via AutoConfiguration.imports; no @ConditionalOnClass (no third-party dep).
- TenantConfig drops @componentscan and registers TenantService as an explicit @bean
  (TenantService loses @Service/@Autowired), so the co-located auto-config is not
  double-registered.
- Core cleanup: FullSpringServiceConfig no longer @imports TenantConfig; the
  data/package-info tenant @link becomes plain text so core Javadoc stays clean under
  failOnWarnings.

Build-coordinate change only — no API/schema/behaviour change to the tenancy logic.
Breaking for a-la-carte consumers who used tenant types via core (add the module).

Spec: docs/specs/016-tenant-feature-module (#34)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Spec 016. TenantServiceTest moves with the package (plain JUnit + Mockito, passes
unchanged). Adds TenantAutoConfigurationTest asserting the module self-activates with
exactly one TenantService bean (no double registration after dropping @componentscan).

Spec: docs/specs/016-tenant-feature-module (#34)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…e + README

Spec: docs/specs/016-tenant-feature-module (#34)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hendrikebbers
hendrikebbers merged commit 5a0f1f7 into main Jul 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extract multi-tenancy into an optional spring-services-tenant module

2 participants