Package does not exist

i created a simple gradle project using build.gradle from https://spring.io/guides/gs/spring-boot/

the project runs when i execute using IntelliJ; not using gradle tasks in Intellij. However, when i execute “gradle build” either from console or IntelliJ, I always get the error “package does not exist” pertaining to import statement from my outer package classes to inner package classes. this is not about importing other artifacts; its a simple import statement for importing inner package classes from outer package classes. using the gradle 5.1.1.

I’m facing very similar issue. Currently using gradle 5.1.1

package does not exist when doing gradle build. When I’m trying to access class from another package, saying package does not exist.
example: I have source packages A, B
I’m trying to access classes of A in B then i didn’t see any compilation error in eclipse/intellij but during build time facing an issue.
Can someone please help here.