Skip to content

Commit

Permalink
Merge pull request quarkusio#25104 from aloubyansky/main-module-build…
Browse files Browse the repository at this point in the history
…-optional

Do not require the main module sources to be present in when resolving the app model
  • Loading branch information
gsmet authored Apr 24, 2022
2 parents d542b4e + 3d62019 commit cdf0738
Showing 1 changed file with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit cdf0738

Please sign in to comment.