diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/utils/MavenWslUtil.kt b/plugins/maven/src/main/java/org/jetbrains/idea/maven/utils/MavenWslUtil.kt index 9573d97e11c0..c8dbb333cd6e 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/utils/MavenWslUtil.kt +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/utils/MavenWslUtil.kt @@ -107,7 +107,11 @@ object MavenWslUtil : MavenUtil() { MavenLog.LOG.debug("Maven home found at /usr/share/maven2") return home } - val processOutput = this.executeOnWsl(listOf("which", "mvn"), WSLCommandLineOptions().setExecuteCommandInLoginShell(true), 10000, null) + + val options = WSLCommandLineOptions() + .setExecuteCommandInLoginShell(true) + .setShellPath(this.shellPath) + val processOutput = this.executeOnWsl(listOf("which", "mvn"), options, 10000, null) if (processOutput.exitCode == 0) { val path = processOutput.stdout.lines().find { it.isNotEmpty() }?.let(this::resolveSymlink)?.let(this::getWindowsPath)?.let(::File) if (path != null) { @@ -172,4 +176,4 @@ object MavenWslUtil : MavenUtil() { val jdkWslDistr = tryGetWslDistributionForPath(ProjectRootManager.getInstance(project).projectSdk?.homePath) ?: return false return jdkWslDistr.id == projectWslDistr.id } -} \ No newline at end of file +}