@ComponentScan(basePackages = {"<pacakge>",...})
This will override the default behavior of @SpringBootApplication annotation.
So need to add all necessary packages.
@ImportResource("classpath:<resource name>")
@Entity
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@ManyToMany
@JoinTable(name = "author_book", joinColumns = @JoinColumn(name = "book_id"),
inverseJoinColumns = @JoinColumn(name = "author_id"))
@ManyToMany(mappedBy = "authors")
@Qualifier("constructorGreetingService)
@Primary
localhost:8080/h2-console JDBC URL: jdbc:h2:mem:testdb
public interface BookRepository extends CrudRepository<Book, Long>
public class DevBootStrap implements ApplicationListener<ContextRefreshedEvent>
@Profile("en")
spring.profiles.active=es
@Profile({"en", "default"})
<html lang="en" xmlns:th="http;//www.thymeleaf.org">
<tbody>
<tr th:each="owner : ${owners}">
<td th:text="${owner?.id}">1</td>
<td th:text="${owner?.firstName}">Panda</td>
<td th:text="${owner?.lastName}">Karady</td>
</tr>
</tbody>