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 61de472 commit 995ad3b
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import java.util.function.Function;
import java.util.stream.Collectors;

import org.jboss.logging.Logger;

import io.dekorate.kubernetes.config.Annotation;
import io.dekorate.kubernetes.config.ConfigMapVolumeBuilder;
import io.dekorate.kubernetes.config.EnvBuilder;
Expand Down Expand Up @@ -106,6 +108,7 @@
import io.quarkus.kubernetes.spi.Subject;

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 +128,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 +143,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 995ad3b

Please sign in to comment.