I created a spring boot project and added 2 child modules to it: contract and infrastructure. Next, I added a dependency on the infrastructure to the contract module’s pom to use classes from there. Everything is ok, idea sees classes from another module, but when I try to execute mvn install
in parent module, I get errors like these:
[ERROR] COMPILATION ERROR :
[ERROR] /Users/markhvostenko/IdeaProjects/cat-service/contract/src/main/java/com/catService/contract/dto/cat/CatDto.java:[12,9] cannot find symbol
symbol: class Color
location: class com.catService.contract.dto.cat.CatDto
[ERROR] /Users/markhvostenko/IdeaProjects/cat-service/contract/src/main/java/com/catService/contract/commands/cat/IsOwnedByWithOwner.java:[3,46] package com.catService.infrastructure.entities does not exist
[ERROR] /Users/markhvostenko/IdeaProjects/cat-service/contract/src/main/java/com/catService/contract/commands/cat/IsOwnedByWithOwner.java:[5,43] cannot find symbol
symbol: class Owner
location: class com.catService.contract.commands.cat.IsOwnedByWithOwner
[ERROR] /Users/markhvostenko/IdeaProjects/cat-service/contract/src/main/java/com/catService/contract/commands/owner/CreateOwner.java:[5,46] package com.catService.infrastructure.entities does not exist
[ERROR] /Users/markhvostenko/IdeaProjects/cat-service/contract/src/main/java/com/catService/contract/commands/owner/CreateOwner.java:[7,27] cannot find symbol
symbol: class User
location: class com.catService.contract.commands.owner.CreateOwner
Here is the repo: https://github.com/Marcelo20044/CatService.git
I tried to find a similar problem, but only found one from 6 years ago. There the problem was in using default packages, but I don’t seem to use those. I tried to do first mvn install
directly in the infrastructure and then in the contract (using maven gui and terminal), but the error was the same.
Marcelo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.