Set the "test" profile when run "mvn test"

by Vic K   Last Updated October 16, 2019 22:26 PM - source

I'm using Spring's @Profile to separate test-related classes from dev and prod. I'm having troubles finding a way to set spring.profiles.active to test automatically, if the goal is test, i.e. mvn test (so not to specify test twice, i.e. mvn test -Ptest). In other words, if the maven goal is test I want the profile to be set to test without having to specifically set it in -P. Is it even possible?

Tags : java spring maven


Related Questions


Jar packaging in Spring boot

Updated October 20, 2017 16:26 PM

Spring Boot properties file externalization

Updated September 13, 2017 09:26 AM

Generate files in 'src' for maven-jaxb2-plugin

Updated January 24, 2018 08:26 AM

Maven Failsafe Classpath

Updated June 20, 2018 21:26 PM