Commit Graph

180 Commits

Author SHA1 Message Date
Oliver Drotbohm
fa946c148b GH-1122 - Consolidate automatic module names. 2025-03-22 15:17:47 +01:00
Oliver Drotbohm
6a98b3624e GH-1105 - Prepare next development iteration. 2025-03-21 11:52:23 +01:00
Oliver Drotbohm
48ecc12337 GH-1105 - Release version 1.4.0-M3. 2025-03-21 11:52:23 +01:00
Oliver Drotbohm
8df778b039 GH-202 - Support for bean instances located in test sources in @ApplicationModuleTest.
Prior to this commit, the TypeExcludeFilter registered by @ApplicationModuleTest decided whether to include a type based on the ApplicationModules instance and the content of the modules' backing JavaPackage instances. Those in turn always consider the classes scanned by ArchUnit to decide whether they include a type or not. As an ApplicationModules instance is set up to only consider production code, any type located in the test sources was disregarded from component scanning.

The checks for package inclusion for a test execution have now been revamped to consider the sole package names when filtering types for inclusion.
2025-03-17 18:35:03 +01:00
Oliver Drotbohm
df4d82dd3f GH-1098 - Optimize type selection in Classes.
We now resort to a simple iteration over the types within a Classes arrangement to detect all classes residing in certain packages. This is primarily used during the JavaPackage data structure construction as it's called for every sub-package of a package originally created from a Classes instance. The new simplified algorithm avoids set up of DescribedPredicate instances to eventually only perform simple package name checks.
2025-03-07 12:42:45 +01:00
Oliver Drotbohm
083ce7beae GH-1098 - Fix performance regression in JavaPackage.
The fix for GH-1039 introduced a performance regression as the calculation of the sub-packages escaped the SingletonSupplier and thus is now included in every hashCode() calculation. Took the chance to significantly revamp the sub-package calculation for nested packages. In other words, the entire sub-package arrangement for a package is calculated once with pre-computed intermediaries held instead of re-computing them per sub-package.
2025-03-04 15:56:50 +01:00
Oliver Drotbohm
f0016c8164 GH-1094 - Prepare next development iteration. 2025-02-25 10:40:49 +01:00
Oliver Drotbohm
95acf1fcac GH-1094 - Release version 1.4.0-M2. 2025-02-25 10:40:48 +01:00
Oliver Drotbohm
bf0c07e222 GH-1052 - ApplicationModuleSource now uses JavaPackage.findAnnotation(…).
This is to make sure that marker types annotated with @PackageInfo are considered, too. Deprecate JavaPackage.getAnnotation(…) as it's not used anywhere anymore and we would like to consistently consider package info marker types when looking up package annotations.
2025-02-23 22:06:30 +01:00
Oliver Drotbohm
417e1c1e8c GH-1066 - Provide abstraction to access ApplicationModuleIdentifiers in order of module dependency.
Introduce ApplicationModuleIdentifiers as abstraction for an ordered collection of application module identifiers.

Introduced ApplicationModuleMetadata as abstraction for the generated metadata (usually located in META-INF/spring-modulith/application-modules.json) to expose the information we currently need to downstream infrastructure components. Migrated the components introduced to execute ApplicationModuleInitializers to AMA and adapt auto-configuration accordingly.
2025-02-22 14:19:32 +01:00
Oliver Drotbohm
65f7bb7a8f GH-1064 - Move AOT processor to generate application module metadata into runtime module. 2025-02-21 23:09:18 +01:00
Oliver Drotbohm
19db2339bd GH-1062 - ApplicationModuleExporter now exposes ApplicationModuleInitializer beans. 2025-02-21 22:49:28 +01:00
Oliver Drotbohm
8fb7f07b4a GH-1060 - Remove optional dependency on JGraphT.
We now implement the topological sorting of application modules ourselves. Properly recalculate module order after ApplicationModules recreation with shared modules. Make iterator resilient against premature invocation by falling back to the unordered modules.

Cleanup of generated type ignorance.
2025-02-21 16:15:33 +01:00
Oliver Drotbohm
013bd8b9aa GH-1042 - Fix module identifier lookup in ApplicationModuleSource.
Before this commit, ApplicationModuleSource inspected all package-info.java contained in given packages, including the sub-packages of those. That caused identifiers explicitly defined in an @ApplicationModule on a package-info.java in nested packages picked up for top-level packages. This is now fixed by only considering the files in the top-level packages.
2025-01-28 23:47:52 +01:00
Oliver Drotbohm
12b6a2d1fd GH-1040 - NamedInterfaces.Builder now does not exclude all packages by default.
Polished NamedInterfaces.toString() for easier debugability.
2025-01-25 13:57:07 +01:00
Oliver Drotbohm
5d8cbca10c GH-1039 - Revamp JavaPackage's sub-package traversal to retain empty intermediate packages. 2025-01-25 13:54:43 +01:00
Oliver Drotbohm
18f10b0401 GH-1038 - Expose ApplicationModuleInformation.
ApplicationModuleInformation is now public as it's referenced from the ApplicationModuleDetectionStrategy SPI. Extracted ApplicationModuleInformationFactory to avoid the internal instance creation logic from leaking.
2025-01-25 13:49:53 +01:00
Oliver Drotbohm
4090499634 GH-1027 - Prepare next development iteration. 2025-01-23 22:16:36 +01:00
Oliver Drotbohm
36370ae31a GH-1027 - Release version 1.4.0-M1. 2025-01-23 22:16:36 +01:00
Oliver Drotbohm
2e31447097 GH-1009 - Allow customizing the detection of NamedInterfaces via ApplicationModuleDetectionStrategy.
The detection of NamedInterfaces for an application module can now be customized by implementing ApplicationModuleDetectionStrategy.detectNamedInterfaces(…). The default implementation of that methods uses the previously default NamedInterfaces.of(…) lookup.

NamedInterfaces and NamedInterface now expose factory methods to be able to construct and combine (through NamedInterfaces.and(…)) instances manually. In particular, the newly introduced NamedInterfaces.builder() method allows setting up a detection configuration that allows picking up packages by naming conventions.
2025-01-16 10:21:42 +01:00
Oliver Drotbohm
f941756242 GH-1015 - Polishing. 2025-01-16 09:43:10 +01:00
Oliver Drotbohm
38b7ac78cd GH-1015 - ModulithMetadata obtained from a package now considers @Modulithic annotations. 2025-01-16 09:42:58 +01:00
Oliver Drotbohm
79a80d2325 GH-1006 - Pick up reference types for event listeners declared in annotations.
We now detect event types a listener is interested in declared in annotations for inclusion the reference documentation. This allows for the rare case that the event listener method not actually declaring the event type as parameter as it might not be needed in the payload but only the fact that an event was published at all.
2025-01-06 19:12:36 +01:00
Oliver Drotbohm
7fabc528b4 GH-1010 - Update copyright declarations to include 2025. 2025-01-06 16:58:45 +01:00
Oliver Drotbohm
dca73ee137 GH-995 - Allow filtering violations. 2024-12-18 20:25:43 +01:00
Oliver Drotbohm
f8728fc009 GH-955 - Prepare next development iteration. 2024-11-21 20:13:56 +01:00
Oliver Drotbohm
6f6597e163 GH-955 - Release version 1.3.0. 2024-11-21 20:13:55 +01:00
Oliver Drotbohm
4218dffc9d GH-936 - Detect methods (meta-)annotated with @MessageMapping as module entry points.
We now consider all methods that are (meta-)annotated with Spring Messaging's @MessageMapping which is consistently used in a lot of broker annotations such as @(Rabbit|Kafka)Listener etc.
2024-11-19 23:01:29 +01:00
Oliver Drotbohm
169cf67128 Generally ignore generated code (annotated with @….Generated). 2024-11-05 16:16:07 +01:00
Oliver Drotbohm
34ce0add03 GH-919 - Add @CheckReturnValue and use it in Scenario API. 2024-10-29 22:15:12 +01:00
Oliver Drotbohm
3d35d48d18 GH-912 - Prepare next development iteration. 2024-10-26 15:58:59 +02:00
Oliver Drotbohm
05c5550312 GH-912 - Release version 1.3.0-RC1. 2024-10-26 15:58:59 +02:00
Oliver Drotbohm
6da5d1dafb GH-874 - Add LICENSE and NOTICE files to binaries. 2024-10-14 22:14:51 +02:00
Oliver Drotbohm
413e2f50b6 GH-846 - Fix module identifier lookup for jMolecules @Module(id = …).
We now properly translate jMolecules' @Module declaration configuring the id attribute explicitly into the identifier used for an application module.

Introduce @ApplicationModule(id = …) for Spring Modulith-native identifier customization.
2024-10-13 19:42:43 +02:00
Oliver Drotbohm
68185a7aef GH-872 - Introduce proper identifiers for ApplicationModules.
Introduced ApplicationModuleIdentifier that ensures that identifiers chosen for application modules do not contain a double colon (::) as we need those as separator characters for manual dependency declarations referring to named interfaces.
2024-10-13 19:41:49 +02:00
Oliver Drotbohm
e3077a7abd GH-862 - Trigger jMolecules architecture verifications if present on the classpath. 2024-10-08 11:14:06 +02:00
Oliver Drotbohm
0c2f79a56d GH-803 - Prepare next development iteration. 2024-09-20 23:26:04 +02:00
Oliver Drotbohm
a3ed03cff3 GH-803 - Release version 1.3.0-M3. 2024-09-20 23:26:03 +02:00
Oliver Drotbohm
438f17b56d GH-813 - Introduce FormattableType.
As replacement for misspelled Formatable type.
2024-09-20 22:02:17 +02:00
Oliver Drotbohm
dc74b414f3 GH-801 - Properly guard for presence of jMolecules' @Module type.
As @Module is absent from the Kotlin flavor of jMolecules, code that refers to that is now guarded with a more specific check for that type in particular.
2024-09-12 16:57:44 +02:00
Oliver Drotbohm
0bbda9a8bd GH-802 - Fix Javadoc. 2024-09-08 15:23:10 +02:00
Oliver Drotbohm
f09f3aa827 GH-802 - Allow transitive application module dependency resolution.
ApplicationModule now exposes both getDirectDependencies(…) and getAllDependencies(…), the former as alias for the now deprecated getDependencies(…) for symmetry reasons. The latter recursively resolves transitive dependencies.

We now optimize the dependency analysis by skipping types residing java and javax packages as they're not relevant to our dependency arrangement model. A few additional optimizations in ApplicationModuleDependencies to avoid iterating over each establishing dependency if all we need to look at is the general module dependency arrangement.

Improve performance of ApplicationModule.contains(…) checks by checking whether the given type can even live inside the package space of the module.
2024-09-06 21:41:35 +02:00
Oliver Drotbohm
636b5988cb GH-797 - Guard against multiple non-unique module base packages. 2024-09-04 10:34:10 +02:00
Oliver Drotbohm
1062f53bfa GH-613 - Add SPI to support external ApplicationModuleSource contributions.
We now expose ApplicationModuleSourceFactory as Spring Factories-based SPI interface to further contribute ApplicationModuleSource instances either from a provided root package subject for module detection through a (potentially customized) ApplicationModuleDetectionStrategy or by explicitly listing particular module base packages.
2024-09-04 08:51:19 +02:00
Oliver Drotbohm
b370d5a3f2 GH-787 - Allow references between sibling sub-modules.
Previously, we rejected references between sub-modules both contained in the same parent package.

Related ticket: GH-578.
2024-08-30 18:22:02 +02:00
Oliver Drotbohm
65178e42de GH-785 - Prepare next development iteration. 2024-08-23 12:36:24 +02:00
Oliver Drotbohm
fbff89425f GH-785 - Release version 1.3.0-M2. 2024-08-23 12:36:24 +02:00
Oliver Drotbohm
7838204c25 GH-578 - Support for nested application modules.
The ApplicationModules bootstrap now triggers the module base package detection, followed by a new, additional pass of detecting nested application module packages. Those packages are now added to the ones we create ApplicationModule instances for and also handed into the module instance creation step as exclusions to make sure that parent modules do not include code residing in sub-modules.

The bootstrap of ApplicationModules now uses a dedicated ApplicationModuleSource to allow calculating a default module name relative to the application base package.

Each module now operates on the Classes instance obtained from the JavaPackage instance that constitutes the module's base package but filtered by the given exclusions.
2024-08-16 17:09:51 +02:00
Oliver Drotbohm
b927bf1211 GH-764 - Prevent ApplicationModuleInformation from picking up info from nested packages. 2024-08-13 22:01:01 +02:00
Oliver Drotbohm
ff6f09606b GH-761 - Open up ApplicationModules.of(…) to take a DescribedPredicate<? super JavaClass>. 2024-08-13 16:26:47 +02:00