Extract multi-tenancy into spring-services-tenant module (spec 016)#35
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extracts the
com.openelements.spring.base.tenantpackage out ofspring-services-coreinto a new optional feature modulespring-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
docs/specs/016-tenant-feature-module/docs/specs/016-tenant-feature-module/design.mddocs/specs/016-tenant-feature-module/behaviors.mdChanges
spring-services-tenantmodule (depends on core; PomChecker-compliant<url>); wired into the reactor,spring-services-all, and the BOM.TenantAutoConfiguration(@Import(TenantConfig)) self-activates viaAutoConfiguration.imports; no@ConditionalOnClass(no third-party dep).TenantConfigdrops@ComponentScanand registersTenantServiceas an explicit@Bean(service loses@Service/@Autowired) → co-located auto-config is not double-registered.FullSpringServiceConfigno longer@ImportsTenantConfig; thedata/package-infotenant{@link}becomes plain text so core Javadoc stays clean underfailOnWarnings.@EnableTenant/@Import(TenantConfig)still work.Test coverage
TenantServiceTestmoved unchanged (tenancy behavior) + newTenantAutoConfigurationTest(self-activation, single bean / no double registration). 5 tests.-Pfull-build clean verify -Dmaven.javadoc.failOnWarnings=truegreen across all 11 modules (0 javadoc warnings; core compiles/Javadocs clean without tenant).Note
Breaking for à-la-carte consumers who used tenant types via
spring-services-coredirectly — they addspring-services-tenant(or usespring-services-all, unchanged). Documented indocs/releases/upgrade-to-1.4.md.Closes #34
🤖 Generated with Claude Code