Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use spring boot and runtime configuration of data sources. #2

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/.settings
/.classpath
/.project
/.idea
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,12 @@ things as much as possible to establish how best to do it.

It's built with Maven, so from the command line you can run a full build (including tests):

mvn clean install
mvn clean package

The configuration of the data sources is in src/test/resources/application.yml Those settings may be overridden by
an application.yml (or application-test.yml) in the root folder. Doing this override lets you run with alternate
settings without recompiling the module.




23 changes: 23 additions & 0 deletions application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#spring:
# profiles: test
#
# main:
# show-banner: true
#
# jpa:
# show-sql: false
# generate-ddl: true
# database: H2
# hibernate.naming_strategy: org.hibernate.cfg.ImprovedNamingStrategy
#
# fooDataSource:
# driverClassName: org.h2.Driver
# url: jdbc:h2:mem:foodb;MODE=PostgreSQL;INIT=CREATE SCHEMA IF NOT EXISTS foo;DB_CLOSE_ON_EXIT=FALSE
# username: foo
# password:
#
# barDataSource:
# driverClassName: org.h2.Driver
# url: jdbc:h2:mem:bardb;MODE=PostgreSQL;INIT=CREATE SCHEMA IF NOT EXISTS bar;DB_CLOSE_ON_EXIT=FALSE
# username: bar
# password:
Loading