Commit Graph

52 Commits

Author SHA1 Message Date
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
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
9568f29613 GH-267 - Explicitly declared empty allowed dependencies now forbids any dependency.
The default for @ApplicationModule(allowedDependencies) is now a single element list with a dedicated token we recognize as "all dependencies allowed". This allows users to declare an empty array explicitly to disallow any outgoing dependencies for an application module. Previously, such a declaration would have allowed any dependency.
2023-08-15 19:52:02 +02:00
Oliver Drotbohm
43418b5fe0 GH-246 - Upgrade to ArchUnit 1.1.0.
Related tickets: GH-221.
2023-08-09 21:21:18 +02:00
Oliver Drotbohm
9fe114387a GH-221 - Temporarily shadow ArchUnit's Location type.
It includes the fix submitted for TNG/ArchUnit#1131. To be removed once we can upgrade to a released version of the fix.
2023-07-20 16:26:32 +02:00
Oliver Drotbohm
fb839cb8a5 GH-230 - Caches in ApplicationModules and ArchitecturallyEvidentType are now ConcurrentHashMaps. 2023-07-05 13:56:01 +02:00
Oliver Drotbohm
547b6091f0 GH-229 - ApplicationModuleExporter can now write output to a file. 2023-07-05 13:54:45 +02:00
Oliver Drotbohm
9bfcf71a5d GH-227 - ApplicationModulesExporter now writes JSON containing named interfaces. 2023-06-30 17:29:56 +02:00
Oliver Drotbohm
4656f82089 GH-187 - Do not include non-exposed Spring beans that implement interfaces in Application Module Canvas by default.
We now properly check whether one of a Spring bean's implemented interfaces is exposed by the module before including it in the default rendering of the Application Module Canvas.
2023-04-30 22:35:14 +02:00
Oliver Drotbohm
394e87337b GH-187 - Unit tests for Spring Data repository detection.
Both imperative and reactive flavours.
2023-04-28 20:22:27 +02:00
Oliver Drotbohm
fbd2c2e66f GH-182 - Use dedicated SliceAssignment to verify modularity.
The previous modularity verification arrangement assumed the default module detection strategy to be used. To properly support alternative implementations during the verification we now use a dedicated SliceAssignment implementation that assigns types to slices identified by the module they are located in.
2023-04-23 23:24:02 +02:00
Oliver Drotbohm
d9f298c96a GH-183 - Improvements in named interface declarations.
Type based named interfaces on types declared in a module's API package still caused the type to be included in the unnamed interface. This is now fixed by explicitly removing named interface types from the unnamed interface.

We now also detect API package types assigned to a named interface without an explicit name as the package name defaulting doesn't work in this case.

Furthermore, named interfaces are now sorted alphabetically to make the unnamed one always appear first.
2023-04-23 23:21:00 +02:00
Oliver Drotbohm
daee88a227 GH-177 - Javadoc polishing. 2023-03-31 13:44:06 +02:00
Oliver Drotbohm
2454ecbc4b GH-177 - Named interfaces names now default to the local package name.
Both package- and type-level declarations now use the local package name as the named interface's name. This allows to, at the same time, easily declared named interfaces based on packages but also a nice decoupling of the interface definition and the package layout as individual types can be assigned to such interfaces no matter where they are actually declared.
2023-03-31 13:34:21 +02:00
Oliver Drotbohm
c58497979d GH-170 - Improve log output for ApplicationModule.
We now consider whether a type is exposed by a module to determine whether it is reported as public (+) or contained (o) type.
2023-03-23 13:00:56 +01:00
Oliver Drotbohm
d0ffcddd29 GH-157 - Improve aggregate lookup.
We now directly collect all aggregate types instead of looking up entities first.
2023-03-04 00:21:22 +01:00
Oliver Drotbohm
71f928f5b0 GH-130 - Polishing.
Organized imports.
2023-02-03 11:09:07 +01:00
Oliver Drotbohm
c4fe271689 GH-130 - Fall back to annotated class' name as system name. 2023-02-03 10:52:14 +01:00
Oliver Drotbohm
868fddca50 GH-119 - Added package-info.java for util package. 2023-01-19 15:17:29 +01:00
Oliver Drotbohm
090ddc6fba GH-119 - Improve rendering of application modules structure as JSON.
Introduced ApplicationModulesExporter to render an ApplicationModules instances as JSON directly. To avoid a dependency to a JSON library and as we only have to be able to render rather simple arrangements, we just build up the JSON string ourselves.

ApplicationModulesEndpoint now caches the structure calculated once to avoid repeated work.
2023-01-18 18:39:09 +01:00
Oliver Drotbohm
5c34886907 GH-114 - Rename ….modulith.model to ….modulith.core. 2023-01-12 16:34:07 +01:00
Oliver Drotbohm
0d009f06c9 GH-111 - Package and publish Javadoc.
A lot of Javadoc polish. Not done yet.
2023-01-12 16:20:20 +01:00
Oliver Drotbohm
9ce6bf23ae GH-14 - Remove Lombok from production sources.
Polished a lot of Javadoc.
2023-01-12 01:05:35 +01:00
Oliver Drotbohm
262efb5828 GH-106 - Avoid intercepting Object and proxy-related methods for module interaction tracing.
We now skip Object methods and ones declared on Spring's Advised or TargetClassAware types when intercepting invocations to trigger a module entry.
2023-01-05 20:00:54 +01:00
Oliver Drotbohm
d8463bb84b GH-102 - Avoid topological sorting to fail on cyclic module graphs.
We now fall back to the default non-topological ordering in case the application module graph contains cycles.
2023-01-05 11:21:14 +01:00
Oliver Drotbohm
30203ecca8 GH-104 - Polish log output for test execution.
Also added ApplicationModules.toString().
2023-01-05 10:21:42 +01:00
Oliver Drotbohm
a7e033172b GH-102 - ApplicationModules now allows traversing modules in topological order.
We now optionally integrate with the JGraphT library to calculate the topological order of modules based on their dependency structure. That order is then exposed in ApplicationModules' iteration and via ….getComparator().

Renamed FormattableJavaClass to FormattableType and allow it to be created from a plain Class as well.
2023-01-05 10:21:36 +01:00
Oliver Drotbohm
4e13fbf7f8 GH-99 - Extend license headers to 2023. 2023-01-02 18:12:29 +01:00
Oliver Drotbohm
c1fc3032b7 GH-87 - Expose module structure as actuator endpoint.
Introduce Spring Modulith Actuator module to expose the application module structure as Spring Boot actuator. This required a Spring Modulith Runtime module to be extracted from the Spring Modulith Observability one. The former now contains the auto-configured ApplicationRuntime and ApplicationModulesRuntime bean instances to be able to bootstrap a ApplicationModules asynchronously on application startup. The actuator module then contains a Spring Boot @Endpoint implementation consuming the ApplicationModules to render JSON describing the application module structure.
2022-12-23 10:56:47 +01:00
Oliver Drotbohm
065db76547 GH-74 - Polishing. 2022-11-18 00:13:30 +01:00
Oliver Drotbohm
22993f43d9 GH-74 - Bean references in Application Module Canvas now get de-duplicated. 2022-11-18 00:13:18 +01:00
Oliver Drotbohm
55b16857f3 GH-69 - Switch to Stream.toList(). 2022-11-11 18:49:03 +01:00
Oliver Drotbohm
d96263fe30 GH-11, GH-66, GH-67, GH-68 - Improve module canvas.
Overhauled the module canvas in various ways. By default, we now skip "empty" rows. In other words, if we do not find any published events for example, we skip the entire row. CanvasOptions.revealEmptyRows() can be used to keep those empty rows around. We now also expose all value types and Spring bean references.

Refactored the dependency lookup APIs on ApplicationModule. Both DependencyType and DependencyDepth are now top-level types. Also, ApplicationModuleDependency and ApplicationModuleDependencies were introduced as explicit types. In the course of that, ApplicationModule.getDependencies(…) has got its return type changed from List<ApplicationModule> to ApplicationModuleDependencies. The internal ModuleDependency type has been renamed to QualifiedDependency.
2022-11-11 18:33:03 +01:00
Oliver Drotbohm
62ac231ce4 GH-65 - Reduced indentation of Spring Bean types in test execution log output. 2022-11-11 14:04:39 +01:00
Oliver Drotbohm
8591fbb64a GH-47 - Treat efferent dependencies of configuration properties classes as simple dependencies. 2022-10-21 11:11:27 +02:00
Oliver Drotbohm
2430dc90e2 GH-46 - Bootstrap dependencies must only contain DependencyType.USES_COMPONENT. 2022-10-21 11:11:24 +02:00
Oliver Drotbohm
1b3228426b GH-44 - ApplicationModules.verify() now returns itself. 2022-10-17 12:53:36 +02:00
Oliver Drotbohm
c192a7dd14 GH-42 - Upgrade to ArchUnit 1.0. 2022-10-13 17:23:49 +02:00
Oliver Drotbohm
5f6b82ef2d GH-40 - Switch to C4 component diagrams by default.
We now render the module component diagrams in C4 style by default. Changed the implementation of ApplicationModuleInformation to fallback to the simple module name by default unless fully-qualified module names are enabled.
2022-09-20 17:08:35 +02:00
Oliver Drotbohm
0c81d9025d GH-36 - Fix invalid named interface reference in ApplicationModule.
0fbf7b introduced a bug in which the named interface referenced by an explicit allowed dependency declaration was accidentally switched to be resolved against the source module, not the target one.
2022-09-12 15:59:58 +02:00
Oliver Drotbohm
bdb90e9298 GH-37 - Hide internal aggregates and components by default in module canvas.
We now only include exposed types in the module canvas rendered. This can be overridden by calling CanvasOptions.revealInternals().
2022-09-12 15:45:08 +02:00
Oliver Drotbohm
0fbf7b33b1 GH-36 - Better exception message for invalid, explicit module dependency declarations. 2022-08-11 11:29:55 +02:00
Oliver Drotbohm
7e890fd705 GH-36 - Better dependency verification for named interfaces.
We now verify detected dependencies against optionally explicitly defined ones. Those can refer to named interfaces (via the "moduleName :: namedInterfaceName" syntax). If such an allowed dependency is defined, all dependencies towards other named interfaces (also the unnamed one) are rejected.

Some Javadoc polishing.
2022-08-09 16:13:09 +02:00
Oliver Drotbohm
82c18fe509 GH-9 - Rename core, public abstractions from Module to ApplicationModule.
Remove obsolete @since tags and deprecations.
2022-07-19 15:34:44 +02:00
Oliver Drotbohm
8ba6c11e3d GH-1 - Consistent license years and HTTPS URLs. 2022-07-19 15:04:52 +02:00
Oliver Drotbohm
48ea08ae59 GH-1 - Consistent author names. 2022-07-19 15:02:00 +02:00
Oliver Drotbohm
b2425d024a GH-1 - Polishing.
Fix import order after package renames.
2022-07-08 09:35:55 +02:00