mercredi 2 décembre 2015

Override TeamCity environment variable in Maven

TeamCity provides several environment variables that are made available in Maven's pom.xml. For example, my build agent has a property env.JDK_18 pointing to a JRE installation on the server. I use this property in my configuration of the surefire plugin in Maven:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
        <jvm>${env.JDK_18}/bin/java</jvm>
        <!-- ... -->
    </configuration>
</plugin>

Unfortunately, the environment variable is not available on my local machine. Is there any Maven option to define the environment variable locally (in my pom.xml file) and have TeamCity override it, when unit tests are run on the build server?

Aucun commentaire:

Enregistrer un commentaire