Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bulid.war File Using Different application.properties files (Maven) in intelij IDEA

I have a different application.properties file for Different Environment (Dev,QA,Prod)

application.properties

Is there any setting/way to use this Quick access menu

enter image description here

Without using Maven command line

like image 697
DeC Avatar asked Dec 19 '25 22:12

DeC


1 Answers

We Can Change the content of aplication.properties file as below

aplication.properties

spring.profiles.active=dev

aplication-dev.properties

 #DEV
 spring.datasource.driverClassName=com.mysql.jdbc.Driver
 spring.datasource.url=jdbc:mysql:/localhost:3306/db-dev?useSSL=false
 spring.datasource.username=root
 spring.datasource.password=root
 .......

aplication-qa.properties

#QA
spring.datasource.driverClassName=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql:/localhost:3306/db-qa?useSSL=false
spring.datasource.username=root
spring.datasource.password=root
.......

aplication-prod.properties

 #PROD
 spring.datasource.driverClassName=com.mysql.jdbc.Driver
 spring.datasource.url=jdbc:mysql:/localhost:3306/db-prod?useSSL=false
 spring.datasource.username=root
 spring.datasource.password=root
 .......

This will Fix the above issue

like image 149
DeC Avatar answered Dec 22 '25 00:12

DeC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!