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!
After adding models dependcy in Spring boot. Spring-Boot pom.xml looks like this in pic.
Import an existing moduleFrom the main menu, select File | New | Module from Existing Sources. In the dialog that opens, specify the path the . iml file of the module that you want to import, and click Open. By doing so, you are attaching another module to the project without physically moving any files.
Right click on project and select open module settings. Go to dependencies tab. click plus sign and add the module you want to use.
By default, IntelliJ IDEA shows all classes, methods, and other elements of the current file. To toggle the elements you want to show, click the corresponding buttons on the Structure tool window toolbar. to show class fields. to have protected class members shown in the tree.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With