Open Maven project in LightPlatformCodeInsightFixtureTestCase
Answered
Hello,
I'm trying to make a test for my plugin. My plugin works with Maven pom.xml dependencies. As I understand for test plugin functionality I need to open or import the Maven project in the test case.
I tried
MavenProjectsTree.read(myProject, Paths.get("pom.xml"))
but no success.
Also, I tried something like
val myProjectsManager = MavenProjectsManager.getInstance(myProject)
val virtualFile = LocalFileSystem.getInstance().findFileByIoFile(new File("pom.xml"))
val files = util.Arrays.asList(virtualFile)
myProjectsManager.addManagedFiles(files)
Maybe someone can help me with this issue. In any case, thank you!
Best regards,
Alex.
Please sign in to leave a comment.
Please see org.jetbrains.idea.maven.MavenImportingTestCase and related from Maven plugin sources (bundled in IJ Community)
Thank you, Yann! This is useful information.