Skip to content

Commit

Permalink
Revert optimizations in Spring Modulith dependency setup
Browse files Browse the repository at this point in the history
The removal of the core dependency causes the BOM not being added as
that's contained in the dependency declaration. Manually adding the BOM
(build.boms().add(…)) adds the BOM segment but does not declare the
version property that's needed to resolve it properly.

See gh-1490
  • Loading branch information
odrotbohm authored and mhalbritter committed May 28, 2024
1 parent 43ec67c commit 4145dbb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ public void customize(Build build) {
dependencies.add("modulith-observability",
modulithDependency("observability").scope(DependencyScope.RUNTIME));
}
boolean persistenceBackendAdded = addEventPublicationRegistryBackend(build);
if (persistenceBackendAdded) {
dependencies.remove("modulith");
}
addEventPublicationRegistryBackend(build);
dependencies.add("modulith-starter-test",
modulithDependency("starter-test").scope(DependencyScope.TEST_COMPILE));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,7 @@ void presenceOfSpringDataModuleAddsModuleEventStarter(String store) {
build.dependencies().add("data-" + store);
this.customizer.customize(build);
assertThat(build.dependencies().ids()).contains("modulith-starter-" + store);
assertThat(build.dependencies().ids()).doesNotContain("modulith");
}

@ParameterizedTest
@ValueSource(strings = { "jdbc", "jpa", "mongodb" })
void presenceOfSpringDataModuleRemovesCoreStarter(String store) {
Build build = createBuild("modulith");
build.dependencies().add("data-" + store);
this.customizer.customize(build);
assertThat(build.dependencies().ids()).doesNotContain("modulith");
assertThat(build.dependencies().ids()).doesNotContain("modulith-starter-core");
}

private Build createBuild(String... dependencies) {
Expand Down

0 comments on commit 4145dbb

Please sign in to comment.