Commit Graph

127 Commits

Author SHA1 Message Date
Oliver Drotbohm
c569a481fd GH-677 - Release version 1.2.1. 2024-06-21 13:57:05 +02:00
Oliver Drotbohm
d66259ed49 GH-662 - Fix named interface detection in case of nested packages.
If named interfaces are declared in nested packages, the name detection might accidentally pick up the names declared in child packages. We now deliberately only inspect the base package.
2024-06-18 13:59:19 +02:00
Oliver Drotbohm
8d86615e91 GH-661 - Dependency checks now explicitly skip module-internal dependencies.
As we process a type's entire type hierarchy for dependencies we might discover a foreign module's internal dependencies for modules that declare allowed dependencies explicitly. Explicitly declared dependencies so far solely verified the target being explicitly listed, which, for internal dependencies does not make sense. We now immediately start checking the source and target modules to be equivalent, in which case we can skip any further processing.
2024-06-18 12:30:25 +02:00
Oliver Drotbohm
4823bbad16 GH-656 - Polishing. 2024-06-17 21:44:27 +02:00
Oliver Drotbohm
702fac54f9 GH-656 - Allow to configure the ApplicationModuleDetectionStrategy via a configuration property.
We now expose a configuration property spring.modulith.detection-strategy that can take either of the two prepared values "direct-sub-packages" (default) or "explicitly-annotated", or a fully qualified class name of the strategy to use.

Removed ApplicationModuleStrategies enum to avoid exposing the enum values as additional implementations. Those are now held as inline lambda expression in the factory methods on ApplicationModuleStrategy. Extracted the lookup of the strategy to use into ApplicationModuleDetectionStrategyLookup for easier testability.
2024-06-17 21:09:47 +02:00
Oliver Drotbohm
b37e39d89e GH-605 - Prepare next development iteration. 2024-06-17 21:09:44 +02:00
Oliver Drotbohm
0d74b1b1d0 GH-605 - Release version 1.2.0. 2024-05-24 12:56:39 +02:00
Oliver Drotbohm
cffb0a242d GH-587 - Re-establish proper ApplicationModules instance caching.
The previous change unfortunately altered the CacheKey type in a way that it does not result in equal instances for the same set of parameters, primarily because SingletonSupplier does not implement equals(…)/hashCode(). We now resort to include the ModulithMetadata source in the equals(…) / hashCode() calculation rather than the ModulithMetadata instance itself. This also avoids annotation processing during CacheKey instance creation.
2024-05-23 00:23:02 +02:00
Oliver Drotbohm
21bd2cef75 GH-587 - ModulithMetadata now exposes all base packages.
Previously, we had a variety of places calculating the overall packages to inspect for types. This is now all consolidated into the ModulithMetadata abstraction exposing them directly.
2024-05-20 19:58:30 +02:00
Oliver Drotbohm
04c1203f65 GH-587 - Additional modulith packages are now considered for application classes. 2024-05-20 19:57:23 +02:00
Oliver Drotbohm
51c5f0bf42 GH-601 - Support for wildcard references to named interfaces in explicitly defined allowed application module dependencies.
When defining allowed application module dependencies to named interfaces, the asterisk can now be used to allow referencing all named interfaces declared by the target module.
2024-05-16 16:03:14 +02:00
Oliver Drotbohm
e9203ca159 GH-594 - Polishing. 2024-05-16 13:27:45 +02:00
Oliver Drotbohm
3855479c7c GH-595 - Invalid dependency into named interface now gets reported properly. 2024-05-16 12:34:28 +02:00
Oliver Drotbohm
2bf9f797ec GH-594 - Deduplicate violations with the same message.
Moving away from exceptions as carriers for violations.
2024-05-16 12:20:44 +02:00
Oliver Drotbohm
742ca82f8b GH-561 - Prepare next development iteration. 2024-04-19 18:56:33 +02:00
Oliver Drotbohm
c8ec877bc7 GH-561 - Release version 1.2.0-RC1. 2024-04-19 18:56:33 +02:00
Oliver Drotbohm
2667ec626a GH-552 - Upgrade to jGraphT 1.5.2. 2024-04-12 10:36:24 +02:00
Oliver Drotbohm
6b839cf6dc GH-525 - Prepare next development iteration. 2024-03-22 11:41:33 +01:00
Oliver Drotbohm
c441fdf535 GH-525 - Release version 1.2.0-M3. 2024-03-22 11:41:33 +01:00
Oliver Drotbohm
ce2f608e60 GH-536 - Add missing package-info.java files. 2024-03-22 08:48:51 +01:00
Oliver Drotbohm
e41d7ec083 GH-520 - Early reject invalid ApplicationModules bootstraps.
We now immediately reject the ApplicationModules bootstrap in case the initial scanning of the root packages yield no classes at all.
2024-03-05 19:34:47 +01:00
Oliver Drotbohm
c45a0fc9b7 GH-522 - Polishing. 2024-03-05 11:52:04 +01:00
Oliver Drotbohm
5f7e6a2479 GH-522 - Support for package info types.
Introduce @PackageInfo annotation to allow marking a types as alternative to Java's native package-info.java so that annotation lookups on a JavaPackage will also find annotations placed on that type. Useful to declare package scoped metadata like @ApplicationModule and @NamedInterface for languages that do not support packages well enough (read: Kotlin).
2024-03-05 09:55:34 +01:00
Oliver Drotbohm
f3c111f769 GH-284 - Support for open application modules.
Application modules can now be declared as open, which causes internal components being exposed for access by other modules.
2024-02-29 12:58:49 +01:00
Oliver Drotbohm
b73b4ca70a GH-514 - Prepare next development iteration. 2024-02-23 16:54:58 +01:00
Oliver Drotbohm
7315c8a13e GH-514 - Release version 1.2.0-M2. 2024-02-23 16:54:57 +01:00
Lukas Dohmen
d325c83736 GH-508 - Fix parameter name to match Javadoc. 2024-02-23 11:44:52 +01:00
josroseboom
e1e9b237c8 GH-490 - Use Types constant to decide if a type is an entity. 2024-02-14 16:36:15 +01:00
Oliver Drotbohm
c06a2c915e GH-474 - Prepare next development iteration. 2024-01-19 19:49:09 +01:00
Oliver Drotbohm
6f5886ddef GH-474 - Release version 1.2.0-M1. 2024-01-19 19:49:08 +01:00
Oliver Drotbohm
c32227bdfb GH-463 - Update copyright headers. 2024-01-17 19:45:40 +01:00
Oliver Drotbohm
48aa0b246a GH-406 - Improve detection of AOT types generated by Spring.
We now guard the annotation predicate for @Generated behind a classpath check to avoid a NoClassDefFoundError on previous versions of Spring Framework.
2024-01-17 16:30:40 +01:00
Oliver Drotbohm
b9f3fc2263 GH-418 - Include JSR 303 ConstraintValidator implementations in bootstrap dependency analysis.
Spring Boot configures Hibernate Validator in a way that the latter looks up the components it needs to instantiate via the Spring container. That in turn then creates prototype instances of the types requested. This means, implementations of e.g. ConstraintValidator do not need to be explicitly marked as Spring beans, but could still declare dependencies to other Spring beans. If such a dependency crosses a module boundary, we currently fail to detect that implicitly established module dependency.

This is now fixed by considering ConstraintValidator implementations Spring beans implicitly in out bootstrap dependency analysis.
2023-12-21 18:09:29 +01:00
Oliver Drotbohm
c1f5630a72 GH-406 - Improving the detection of Spring AOT classes.
We now inspect the classes for the newly introduced Spring AOT @Generated annotation instead of a name containing a double underscore.
2023-12-08 22:15:29 +01:00
Oliver Drotbohm
e7b531e061 GH-406 - Ignore Spring AOT generated types in architecture model.
We now explicitly exclude classes generated by Spring AOT in the architectural model. For technical reasons, they might introduce dependencies to application components considered module internals otherwise. Also, proxies generated do not need to be considered either.
2023-12-06 14:17:43 +01:00
Oliver Drotbohm
5bb16e4c93 GH-393 - Prepare next development iteration. 2023-11-24 18:22:06 +01:00
Oliver Drotbohm
c6c0c0f500 GH-393 - Release version 1.1.0. 2023-11-24 18:22:06 +01:00
Oliver Drotbohm
20a7474f2f GH-358 - Prepare next development iteration. 2023-11-03 09:02:46 +01:00
Oliver Drotbohm
6336e32d54 GH-358 - Release version 1.1.0-RC2. 2023-11-03 09:02:45 +01:00
Oliver Drotbohm
889c849492 GH-348 - Avoid eager reference to runtime artifact from core starter.
Removed the inclusion of the spring-modulith-runtime artifact from the …-starter-core one to avoid issues in native images in a Spring Modulith default setup. As the artifact is still needed to support ApplicationModuleInitializer implementations, we now explicitly check for the presence of those and verify the artifact is actually available and hint the user at explicitly adding it if missing.
2023-10-27 09:41:26 +02:00
Oliver Drotbohm
69fd64dbf7 GH-341 - Prepare next development iteration. 2023-10-23 09:12:13 +02:00
Oliver Drotbohm
d4cde409a1 GH-341 - Release version 1.1.0-RC1. 2023-10-23 09:12:13 +02:00
Oliver Drotbohm
86f745e5b7 GH-317 - Fix Javadoc. 2023-10-16 08:28:16 +02:00
Oliver Drotbohm
9148a57b02 GH-317 - Detect violations from types located in root packages.
We now create artificial root application modules for all root packages to detect violations (for example, types located in root packages referring to module-internal types).
2023-10-16 07:57:16 +02:00
Oliver Drotbohm
4a857dcddf GH-323 - Move off of Google's Suppliers.memoize(…). 2023-10-15 19:23:08 +02:00
Oliver Drotbohm
cb6d71ba60 GH-319 - Fix ApplicationModule by package name lookup.
Prior to this commit, the lookup for an ApplicationModule would find modules solely depending on the reference string starting with the base package. That means that a module with base package com.acme.foo, a request for com.acme.foobar would've resulted in a positive match, which of course is wrong.

We now match against either the module's base package or against the reference starting with the base package followed by a dot.
2023-10-15 17:29:27 +02:00
Oliver Drotbohm
61fa94ad63 GH-303 - Prepare next development iteration. 2023-09-21 23:35:47 +02:00
Oliver Drotbohm
6f5b3c0baa GH-303 - Release version 1.1.0-M1. 2023-09-21 23:35:47 +02:00
Oliver Drotbohm
ddaf34d4d8 GH-274 - Prepare next development iteration. 2023-08-21 07:00:02 -07:00
Oliver Drotbohm
6197d35937 GH-274 - Release version 1.0.0. 2023-08-21 06:59:57 -07:00