Class HexagonalArchitectureExtension
java.lang.Object
com.arc_e_tect.gradle.architecture.HexagonalArchitectureExtension
Nested
hexagonalArchitecture {} configuration block for the built-in hexagonal rule
pack, exposed via ArchitectureValidatorExtension.getHexagonalArchitecture().
Every property here is a package-pattern list matched against classes under
ArchitectureValidatorExtension.getBasePackage(), each with a real default reflecting a
conventional hexagonal-architecture layout - override only the ones that don't fit.
-
Constructor Summary
ConstructorsConstructorDescriptionHexagonalArchitectureExtension(org.gradle.api.model.ObjectFactory objects) Creates the extension, with every property already set to its default. -
Method Summary
Modifier and TypeMethodDescriptionorg.gradle.api.provider.ListProperty<String> Adapter package patterns, matching both inbound and outbound adapters not already covered bygetInboundAdapters()/getOutboundAdapters().org.gradle.api.provider.ListProperty<String> Shared/common package patterns, excluded from layer-boundary rules that would otherwise flag code every layer is allowed to depend on.org.gradle.api.provider.ListProperty<String> Package patterns holding Spring (or other DI-framework) wiring/configuration classes.org.gradle.api.provider.ListProperty<String> JDK package patterns the domain model is allowed to depend on, in addition to its owngetDomainModel()packages.org.gradle.api.provider.ListProperty<String> Domain model package patterns - the innermost ring, holding pure value objects/entities.org.gradle.api.provider.ListProperty<String> Domain service package patterns - the layer that implements use-case orchestration and cross-aggregate business rules on top of the domain model.org.gradle.api.provider.ListProperty<String> Framework/library package patterns the domain model, domain services, and ports must never depend on (directly or transitively), enforced bycore_application_layer_must_have_no_denylisted_dependencies.org.gradle.api.provider.ListProperty<String> Additional package patterns inbound adapters must never depend on.org.gradle.api.provider.ListProperty<String> Inbound adapter package patterns.org.gradle.api.provider.ListProperty<String> Inbound port package patterns.org.gradle.api.provider.Property<Boolean> Whether naming-convention rules (bidirectional suffix/package checks, e.g.org.gradle.api.provider.ListProperty<String> Outbound adapter package patterns.org.gradle.api.provider.ListProperty<String> Outbound port package patterns.org.gradle.api.provider.ListProperty<String> Package patterns nested inside a port package that hold pure data-transfer types (commands, queries, results) rather than the port interfaces themselves - excluded from the "ports must be interfaces" and port-naming-convention rules, which apply only to the port contracts.
-
Constructor Details
-
HexagonalArchitectureExtension
@Inject public HexagonalArchitectureExtension(org.gradle.api.model.ObjectFactory objects) Creates the extension, with every property already set to its default. Instantiated by Gradle's extension-creation infrastructure.- Parameters:
objects- Gradle's object factory
-
-
Method Details
-
getInPorts
Inbound port package patterns.- Returns:
- mutable list property of inbound port package patterns
-
getOutPorts
Outbound port package patterns.- Returns:
- mutable list property of outbound port package patterns
-
getDomainModel
Domain model package patterns - the innermost ring, holding pure value objects/entities. Kept disjoint fromgetDomainServices()by default (siblings underapplication.domain, not one nested inside the other) so the domain-model-isolation and domain-service-isolation rules never both match the same class.- Returns:
- mutable list property of domain model package patterns
-
getDomainServices
Domain service package patterns - the layer that implements use-case orchestration and cross-aggregate business rules on top of the domain model. Distinct fromgetDomainModel()(siblings, not nested) so the two isolation rules stay mutually exclusive.- Returns:
- mutable list property of domain service package patterns
-
getAdapters
Adapter package patterns, matching both inbound and outbound adapters not already covered bygetInboundAdapters()/getOutboundAdapters().- Returns:
- mutable list property of adapter package patterns
-
getInboundAdapters
Inbound adapter package patterns.- Returns:
- mutable list property of inbound adapter package patterns
-
getOutboundAdapters
Outbound adapter package patterns.- Returns:
- mutable list property of outbound adapter package patterns
-
getCommonPackages
Shared/common package patterns, excluded from layer-boundary rules that would otherwise flag code every layer is allowed to depend on.- Returns:
- mutable list property of common package patterns
-
getPortDataTypePackages
Package patterns nested inside a port package that hold pure data-transfer types (commands, queries, results) rather than the port interfaces themselves - excluded from the "ports must be interfaces" and port-naming-convention rules, which apply only to the port contracts.- Returns:
- mutable list property of port data-type package patterns
-
getConfigurationPackages
Package patterns holding Spring (or other DI-framework) wiring/configuration classes. Only classes in these packages - plus domain service classes themselves - may reference domain service implementations directly; every other class must go through a port instead.- Returns:
- mutable list property of configuration package patterns
-
getDomainAllowedPackages
JDK package patterns the domain model is allowed to depend on, in addition to its owngetDomainModel()packages. Enforced by thedomain_must_only_depend_on_domain_or_jdk_corerule, which requires every non-JDK dependency of a domain class to resolve back intogetDomainModel()- keeping the domain layer free of adapters, application services, ports, and any third-party or framework dependency by construction, rather than by naming a growing list of things it must avoid.- Returns:
- mutable list property of JDK package patterns allowed from the domain model
-
getFrameworkDenylistPackages
Framework/library package patterns the domain model, domain services, and ports must never depend on (directly or transitively), enforced bycore_application_layer_must_have_no_denylisted_dependencies. Empty by default so the rule is a no-op until a project opts in with its own framework list (e.g.'org.springframework..', 'jakarta..', 'org.hibernate..').- Returns:
- mutable list property of denylisted framework package patterns
-
getInboundAdapterDenylistPackages
Additional package patterns inbound adapters must never depend on. The built-ininbound_adapters_must_access_application_through_inbound_portsrule always blocks direct dependencies on the domain model, outbound ports, outbound adapters, and configuration; this list lets a project extend that deny-list for its own libraries.- Returns:
- mutable list property of additional inbound-adapter denylisted package patterns
-
getNamingConventionsEnabled
Whether naming-convention rules (bidirectional suffix/package checks, e.g. inbound port interfaces must end inUseCase/InputPortand vice versa) are enabled, in addition to the layer-boundary rules.- Returns:
- mutable property for the naming-conventions-enabled flag
-