Import maven projects and source folders
Answered
I have maven project with internal maven projects like a tree. For example:
Maven project A has A1 and A2. A1 has A11 and A12. A2 also has A21 and A22.
The maven projects that do not have children projects have source folders and test folders. I decide to open Maven project A in the Intellij Idea. In the past the Intellij Idea automatically detects source and test folders. Now this is not working. Every maven project is created as module but I have to open Project Structure dialog, to select every module and to mark manually source folders and test folders. What is wrong? This is working in the past and source and test folders are detected automatically. Do you have any idea what I can do?
Please sign in to leave a comment.
Hello,
Is it possible to provide sample project example for investigation?
Hello,
Actually I can't :( I tried to create simple maven project with internal projects and the Intellij Idea is working as it's expected - source folders are detected.
The main project pom file doesn't have parent. Let's call it project Test. But in the case when the Intellij Idea cannot detect source folders, there is parent project. So, I tried to import any of the internal maven pom files of project Test as Intellij Idea project and again the source folders are detected.
Just one note - before every import I delete every .idea folder.
On the next step I change the pom file of our Test project and add additional info for project parent to be the same parent as our big project where source folders cannot be detected. Surprice - this time the Intellij Idea doesn't detect source folders of the simple Test project. So, the problem is not if there is or not parent project because it's working as expected when internal maven pom file of project Test is imported.
I downloaded the parent project, build it locally on my machine and again I tried to import the project Test. Now, it's working, the source folders are detected - wow.
Why it's important if the Test project has parent or not? Yes, dependencies is one of the reason, but why there is a problem with source folder detection in some cases?
Could you please provide idea.log ("Help | Show Log in...") after reproducing the issue? Probably it will show some issue with importing process.