From 3d62019ff48a31b88c80601f6db8c52dd47938e4 Mon Sep 17 00:00:00 2001 From: Alexey Loubyansky Date: Fri, 22 Apr 2022 17:21:28 +0200 Subject: [PATCH] Do not require the main module sources to be present in when resolving the app model --- .../resolver/BootstrapAppModelResolver.java | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/BootstrapAppModelResolver.java b/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/BootstrapAppModelResolver.java index 2291675ec2966..31f965bafee4d 100644 --- a/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/BootstrapAppModelResolver.java +++ b/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/BootstrapAppModelResolver.java @@ -179,20 +179,22 @@ public ApplicationModel resolveManagedModel(ArtifactCoords appArtifact, */ public ApplicationModel resolveModel(WorkspaceModule module) throws AppModelResolverException { - if (!module.getMainSources().isOutputAvailable()) { - throw new AppModelResolverException(""); - } final PathList.Builder resolvedPaths = PathList.builder(); - module.getMainSources().getSourceDirs().forEach(s -> { - if (!resolvedPaths.contains(s.getOutputDir())) { - resolvedPaths.add(s.getOutputDir()); - } - }); - module.getMainSources().getResourceDirs().forEach(s -> { - if (!resolvedPaths.contains(s.getOutputDir())) { - resolvedPaths.add(s.getOutputDir()); + if (module.hasMainSources()) { + if (!module.getMainSources().isOutputAvailable()) { + throw new AppModelResolverException("The application module hasn't been built yet"); } - }); + module.getMainSources().getSourceDirs().forEach(s -> { + if (!resolvedPaths.contains(s.getOutputDir())) { + resolvedPaths.add(s.getOutputDir()); + } + }); + module.getMainSources().getResourceDirs().forEach(s -> { + if (!resolvedPaths.contains(s.getOutputDir())) { + resolvedPaths.add(s.getOutputDir()); + } + }); + } final Artifact mainArtifact = new DefaultArtifact(module.getId().getGroupId(), module.getId().getArtifactId(), null, ArtifactCoords.TYPE_JAR, module.getId().getVersion());