SATURN  RING  STATION

At a distant space view post, we chat about codes.

Spring Data JPA excludes database in certain environment/profile.

In some scenario, we just don’t need the database at all, but Spring Data JPA gets error at start up complaining no DB connection.

We can exclude the database connection classes from being created. Then include them back when needed.

First we exclude them from Spring Boot auto-configuration.

By including, I means we reconfigure Spring Data JPA, when a DB is needed in certain environment/profile.

 

Btw this whole app is on GitHub, in CrawlerWithDB folder.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Spring Data JPA excludes database in certain environment/profile.