From dc60cd23b46c0ea2e9d6b29255c9354b83ada062 Mon Sep 17 00:00:00 2001 From: Alexey Loubyansky Date: Thu, 28 Mar 2024 22:23:01 +0100 Subject: [PATCH] Normalize project dir argument value of domino commands --- .../java/io/quarkus/domino/cli/BaseDepsToBuildCommand.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/domino/app/src/main/java/io/quarkus/domino/cli/BaseDepsToBuildCommand.java b/domino/app/src/main/java/io/quarkus/domino/cli/BaseDepsToBuildCommand.java index 9fd9bd54..1f99ce4a 100644 --- a/domino/app/src/main/java/io/quarkus/domino/cli/BaseDepsToBuildCommand.java +++ b/domino/app/src/main/java/io/quarkus/domino/cli/BaseDepsToBuildCommand.java @@ -1,6 +1,5 @@ package io.quarkus.domino.cli; -import io.quarkus.bootstrap.resolver.maven.BootstrapMavenException; import io.quarkus.bootstrap.resolver.maven.MavenArtifactResolver; import io.quarkus.bootstrap.resolver.maven.options.BootstrapMavenOptions; import io.quarkus.devtools.messagewriter.MessageWriter; @@ -245,7 +244,7 @@ protected void initConfig(ProjectDependencyConfig.Mutable config) { if (!projectDir.isDirectory()) { throw new RuntimeException(projectDir + " is not a directory"); } - config.setProjectDir(projectDir.toPath()); + config.setProjectDir(projectDir.toPath().normalize().toAbsolutePath()); } final Set excludeKeys; @@ -346,11 +345,11 @@ protected MavenArtifactResolver getArtifactResolver() { return artifactResolver = MavenArtifactResolver.builder().setWorkspaceDiscovery(false).build(); } return MavenArtifactResolver.builder() - .setCurrentProject(projectDir.getAbsolutePath()) + .setCurrentProject(projectDir.getCanonicalPath()) .setEffectiveModelBuilder(true) .setPreferPomsFromWorkspace(true) .build(); - } catch (BootstrapMavenException e) { + } catch (Exception e) { throw new RuntimeException("Failed to initialize Maven artifact resolver", e); } }