You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Michael Sela <mi...@cord3inc.com> on 2018/05/25 14:38:10 UTC

Help with MavenSureFire

Hello,

I am trying to run a maven test phase during a bamboo build plan. My tests rely on a set of environment variables that I configured in the pom.xml. However, those values are only applicable to one environment, and I would like to execute the same tests on multiple environments (different host IPS, etc). My Pom.xml looks something like this:

<plugin>

    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.21.0</version>

    <configuration>

        <environmentVariables>

<variable1>variablevalue</variable1>
        </environmentVariables>
    </configuration>


</plugin>

During the bamboo build plan, I execute mvn clean test. Does anyone know how I can configure surefire to possibly read environment variables from a file or something and then execute the mvn command line to read the proper file based on the environment I feed it in the command line. Example mvn clean -DtestEnv test. This way in my build plan I can run the test phase for the environment it is relevant for.

Thanks
Michael.


Re: Help with MavenSureFire

Posted by Marco Schulz <ma...@outlook.com>.
may you can use profiles for each environment to iniciate your variables.

Get Outlook for Android<https://aka.ms/ghei36>

________________________________
From: Michael Sela <mi...@cord3inc.com>
Sent: Friday, May 25, 2018 9:38:10 AM
To: 'users@maven.apache.org'
Subject: Help with MavenSureFire

Hello,

I am trying to run a maven test phase during a bamboo build plan. My tests rely on a set of environment variables that I configured in the pom.xml. However, those values are only applicable to one environment, and I would like to execute the same tests on multiple environments (different host IPS, etc). My Pom.xml looks something like this:

<plugin>

    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.21.0</version>

    <configuration>

        <environmentVariables>

<variable1>variablevalue</variable1>
        </environmentVariables>
    </configuration>


</plugin>

During the bamboo build plan, I execute mvn clean test. Does anyone know how I can configure surefire to possibly read environment variables from a file or something and then execute the mvn command line to read the proper file based on the environment I feed it in the command line. Example mvn clean -DtestEnv test. This way in my build plan I can run the test phase for the environment it is relevant for.

Thanks
Michael.