Announcement Announcement Module
Collapse
No announcement yet.
How to pass active Maven profiles as Spring bean profiles? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to pass active Maven profiles as Spring bean profiles?

    Env: Maven 2.x, Spring 3.1.0.RC1

    When trying to use Spring bean profiles in my Maven tests via the spring.profiles.active system property, I want to pass a comma-separated list of the active Maven profiles since I have a one-to-one mapping from my active Maven profiles to my Spring bean profiles.

    What's the magic Maven property expression I need? I've been trying variants of the following (see <argLine> below):
    Code:
    ...
                <plugin>                
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <argLine>-Dspring.profiles.active=${project.build.profiles.active}</argLine>
    ...
    Thanks,
    Matthew
Working...
X