1. "Failed to process import candidates for configuration class [Com.simple ...]":
Main reasons:
This is because your custom starter is packaged with Spring-boot-maven-plugin, which is configured in the Pom.xml of your custom starter project:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
This type of package, is based on the spring boot packaging, classpath settings, relative directory, resource directory, and so on. When you use this custom starter jar package with another spring boot project. There will be problems because you think that this starter is an ordinary jar package.
This will not find your class definition.
Workaround:
Remove the packaged plug-in settings from the Pom.xml in the custom starter, using the default Jar wrapping method. can solve this problem.
2." java.lang.IllegalArgumentException: Not an managed type: class .... ”
Root cause:
Some of the JPA, entities, and repository classes you use are not the directories where your spring boot boot files are located. Causes JPA to search for these entities, the Repository class.
Workaround:
Add the following annotations to the start class of Spring boot:
@EnableJpaRepositories ("com.example.repository")//The package paths of JPA-related entities and repository that are not searchable
@EntityScan ("Com.example.repository")
If you use the MONGO JPA you should also add the corresponding.
@EnableMongoRepositories ("Com.example.mongo")
@EnableJpaRepositories ("Com.example.repository")
@EntityScan ("Com.example.repository")
Spring boot (3)---Custom Spring boot starter Issues