Skip to content

Commit

Permalink
Log error when project cannot be created
Browse files Browse the repository at this point in the history
  • Loading branch information
metacosm committed Sep 21, 2023
1 parent c19faac commit a6c3946
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@
import io.quarkus.kubernetes.spi.Property;
import io.quarkus.kubernetes.spi.RoleRef;
import io.quarkus.kubernetes.spi.Subject;
import org.jboss.logging.Logger;

public class KubernetesCommonHelper {
private static final Logger LOG = Logger.getLogger(KubernetesCommonHelper.class);
private static final String ANY = null;
private static final String OUTPUT_ARTIFACT_FORMAT = "%s%s.jar";
private static final String[] PROMETHEUS_ANNOTATION_TARGETS = { "Service",
Expand All @@ -125,9 +127,10 @@ public static Optional<Project> createProject(ApplicationInfoBuildItem app,
public static Optional<Project> createProject(ApplicationInfoBuildItem app,
Optional<CustomProjectRootBuildItem> customProjectRoot, Path artifactPath) {
//Let dekorate create a Project instance and then override with what is found in ApplicationInfoBuildItem.
final var name = app.getName();
try {
Project project = FileProjectFactory.create(artifactPath.toFile());
BuildInfo buildInfo = new BuildInfo(app.getName(), app.getVersion(),
BuildInfo buildInfo = new BuildInfo(name, app.getVersion(),
"jar", project.getBuildInfo().getBuildTool(),
project.getBuildInfo().getBuildToolVersion(),
artifactPath.toAbsolutePath(),
Expand All @@ -139,6 +142,7 @@ public static Optional<Project> createProject(ApplicationInfoBuildItem app,
buildInfo, project.getScmInfo()));

} catch (Exception e) {
LOG.debugv(e, "Couldn't create project for {0} application", name);
return Optional.empty();
}
}
Expand Down

0 comments on commit a6c3946

Please sign in to comment.