LocalMavenDistribution () { if (PluginManagerCore.isRunningFromSources()) { Path mavenPath = mySourcePath.getValue(); return new LocalMavenDistribution(mavenPath, BundledMaven3.INSTANCE.getTitle()); } else { final Path pluginFileOrDir = Path.of(PathUtil.getJarPathForClass(MavenServerManager.class)); final Path root = pluginFileOrDir.getParent(); // maven3 folder inside maven plugin layout return new LocalMavenDistribution(root.resolve("maven3"), BundledMaven3.INSTANCE.getTitle()); } }