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());