Can't import classes, IntelliJ showing BOOT-INF prefix and it seems to be related

It sounds like you are trying to use a Spring Boot application as a dependency. Generally speaking this isn’t recommended as, like a war file, a Spring Boot application is not intended to be used as a dependency.

The Spring Boot documentation says the following:

If your application contains classes that you want to share with other projects, the recommended approach is to move that code into a separate module. The separate module can then be depended upon by your application and other projects.

If that’s not an option then you’ll need to configure your project to build both the application jar and one that is suitable for use as a dependency. From the same section of the documentation:

If you cannot rearrange your code as recommended above, Spring Boot’s Maven and Gradle plugins must be configured to produce a separate artifact that is suitable for use as a dependency. The executable archive cannot be used as a dependency as the executable jar format packages application classes in BOOT-INF/classes. This means that they cannot be found when the executable jar is used as a dependency.

To produce the two artifacts, one that can be used as a dependency and one that is executable, a classifier must be specified. This classifier is applied to the name of the executable archive, leaving the default archive for use as a dependency.

You’re using Maven so the appropriate configuration would look something like this:

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <classifier>exec</classifier>
            </configuration>
        </plugin>
    </plugins>
</build>

If you were using Gradle, the appropriate configuration would look something like this:

jar {
    enabled = true
}

bootJar {
    classifier = 'exec'
}

With either build system, your application’s executable fat jar will now be published with an exec classifier. The normal jar that can be used as a dependency will be unclassified.