Skip to content

Commit

Permalink
Changed the getModuleFilePath() method which is marked as @ApiStatus.…
Browse files Browse the repository at this point in the history
…Internal
  • Loading branch information
anusreelakshmi934 committed Jan 2, 2025
1 parent 7708ac2 commit a4a80c8
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectUtil;
import com.intellij.openapi.roots.LanguageLevelProjectExtension;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
Expand Down Expand Up @@ -115,8 +116,11 @@ protected Module createMavenModule(File projectDir) throws Exception {
*/
protected Module createMavenModule(String name, String xml) throws Exception {
Module module = getTestFixture().getModule();
File moduleDir = new File(module.getModuleFilePath()).getParentFile();
VirtualFile pomFile = createPomFile(LocalFileSystem.getInstance().findFileByIoFile(moduleDir), xml);
VirtualFile moduleDir = ProjectUtil.guessModuleDir(module);
if (moduleDir == null) {
throw new IllegalStateException("Module directory could not be determined.");
}
VirtualFile pomFile = createPomFile(moduleDir, xml);
importProjects(pomFile);
Module[] modules = ModuleManager.getInstance(getTestFixture().getProject()).getModules();
if (modules.length > 0) {
Expand Down

0 comments on commit a4a80c8

Please sign in to comment.