How to pass build parameters in TeamCity (Maven Surefire plugin)

Hi! I`m using Surefire plugin and set systemPropertyVariable - <browser>, here is the code:
    

     <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.19.1</version>
          <configuration>
          …
               <systemPropertyVariables>
                    <browser></browser>
               </systemPropertyVariables>
          …
          </configuration>
     </plugin>


In TeamCity (Build Configuration Settings, menu Parameters) I define System Properties parameter:

But build was not successful. There is a NullPointerException.

In the same time, I can easily run build using Command Line: mvn test –D browser=firefox


Please, help! How can I pass parameters to my build?
Good day!

1
1 comment

Hello,

TeamCity's system properties can be resolved using common syntax ${propertyName} in pom.xml files.
If you need to pass additional commandline parameters to Maven process, please use "Additional Maven command line parameters" field in Maven build step settings.

0

Please sign in to leave a comment.