I have been reading a lot and can't find a solution that tells me how to inlucde the maven profiles in @activeprofiles annotation . Is it possible or not?
The issue that I am trying to solve to get H2 and flyway start before my tests execute which is not happening. The configuration is decscribed in maven profiles in pom.xml. When the tests run in teamcity it picks the maven profile and execute but as standalone they can't find the configuration for H2 and flyway and fail on starting.
Do you mean to active Spring profiles based on maven profile, if so, you can configure it like so in your pom.xml:
In your test class configure the profiles it should run on ..
For profile specific properties, create an
application-springprofile.properties
in addition to yourapplication.properties
, Spring Boot will first load application.properties then load application-springprofile.properties -- overriding any properties previously configured from application.properties.Finally, you set the maven profile with -P flag