To create a project, go to https://start.spring.io and create a Kotlin-based project. Here are the dependencies of the project:
- Web
- JDBC
- MySQL
- DevTools
- JPA
- H2
You can find these in the pom.xml file. There you can update, add, or remove the dependencies.
To enable JPA auditing, you need to annotate @EnableJpaAuditing annotation on the SocialNetworkApplication.kt class. It will enable the use of JPA functionalities.
Here is the code for this class:
@SpringBootApplication
@EnableJpaAuditing
class SocialNetworkApplication
fun main(args: Array<String>) {
runApplication<SocialNetworkApplication>(*args)
}