Skip to content

Commit 18b56f6

Browse files
committed
ApplicationModules recognizes war and jar as application module candidates
1 parent 4320779 commit 18b56f6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

components/sbm-core/src/main/java/org/springframework/sbm/build/api/ApplicationModules.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.util.ArrayList;
2525
import java.util.List;
2626
import java.util.Optional;
27+
import java.util.Set;
2728
import java.util.stream.Collectors;
2829
import java.util.stream.Stream;
2930

@@ -111,9 +112,10 @@ private List<Module> getModulesContainingMavens(List<MavenResolutionResult> mave
111112
*/
112113
public List<Module> getTopmostApplicationModules() {
113114
List<Module> topmostModules = new ArrayList<>();
115+
Set<String> packagingTypes = Set.of("jar","war");
114116
modules.forEach(module -> {
115117
// is jar
116-
if ("jar".equals(module.getBuildFile().getPackaging())) { // FIXME: other types could be topmost too, e.g. 'war'
118+
if (packagingTypes.contains(module.getBuildFile().getPackaging())) {
117119
// no other pom depends on this pom in its dependency section
118120
if (noOtherPomDependsOn(module.getBuildFile())) {
119121
// has no parent or parent has packaging pom

0 commit comments

Comments
 (0)