Intellij Can't access classes from one module in other module

vyeluri5 :

I have set up my project as Empty Template and added Spring boot project as a module and another module ecomm-models (This contains purely java classes).

I cannot access classes in ecomm-models inside Spring boot project even though I added it as a dependency in Spring-boot project.

Both these projects are under parent-module as in picture.

Any advise that would be great!

enter image description here

enter image description here

After adding models dependcy in Spring boot. Spring-Boot pom.xml looks like this in pic.

enter image description here

vyeluri5 :

The missing part in this project is to add packages inside the ecomm-models project/module.

The path should look like

ecomm-models > src > main > java > {package name} > person.java

Since I didn't create a package, it couldn't find the reference.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=467569&siteId=1