I am new to Intellij and have just started my first Maven project. I have the following directory structure:
MyProject βββ myapp.iml βββ pom.xml βββ src βββ main (sources root) β βββ java β β βββ com β β βββ mysite β β βββ myapp β β βββ App.java β βββ main.iml βββ test (test sources root) βββ java β βββ com β βββ mysite β βββ myapp β βββ AppTest.java βββ test.iml
The problem is that the Intellij compiler cannot resolve the App symbol in AppTest.java . In the project structure, MyProject content root for the MyProject module MyProject , src/main installed in the root content directory for the main module, and src/test installed in the project root for the test module.
I tried the solution here: Add main / java classes to my test / java directory in intellij , but Intellij did not allow me to add src/main as a dependency of src/test . This tells me: the MyProject module should not contain the original root "blah / blah / src / main / java". The root already belongs to the "main" module.
Can someone please tell me how to configure my modules / project so that Intellij can find all classes? Thanks.
source share