I am using spring boot application (maven project) in eclipse. When I run test clean target of maven project, I want to load the active profiles
I have added the property spring.profiles.active=test,aop in application.properties and also in application-test.properties, this does not have any affect.
or setting this property in command line option of IntelliJ IDE as -Dspring.profiles.active=test,aop does not have an effect when the command is test clean. I have also tried setting the JVM argument of the Runner in Intelligent
however @ActiveProfiles("test") works when the test case class is executed from IntelliJ IDE( right click -> run TestCaseClass).
Any clues ?
Add environment variablesFrom the main menu, select Run | Edit Configurations or choose Edit Configurations from the run/debug configurations selector on the toolbar. In the Run/Debug Configurations dialog, select a configuration you want to add the environment variables to.
From the main menu, select Run | Edit Configurations. Select the necessary Spring Boot run configuration to open its settings. Click Modify options. In the list that opens, point to On 'Update' action.
Enable Spring support in IntelliJ IDEAPress Ctrl+Alt+S to open the IDE settings and select Plugins. Open the Installed tab, search for Spring and make sure that the checkboxes next to all relevant plugins are selected.
Setting the VM Options with -Dspring.profiles.active=test
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With