0

I'm trying to implement Maven profile in my cucumber bdd automation framework, I want my each execution environments to be maven profile and based on active profile my PropertyReader should read that environments property file, how to achieve that? Thanks for the help in advance! For example: below are maven profiles in my pom.xml and I have 3 properties files in my project, so in this case I need to write generic code that should get all properties from dev.properties file and how to run it from command line?

<profiles>
    <profile>
        <id>dev</id>
        <activation>
            <activeByDefault>true</activeByDefault>
            <property>
                <name>env</name>
                <value>dev</value>
            </property>
        </activation>
    </profile>
    <profile>
        <id>stage</id>
        <activation>
            <property>
                <name>env</name>
                <value>stage</value>
            </property>
        </activation>
    </profile>
    <profile>
        <id>prod</id>
        <activation>
            <property>
                <name>env</name>
                <value>prod</value>
            </property>
        </activation>
    </profile>
</profiles>
ZackSalom
  • 31
  • 3

0 Answers0