Build steps for Maven project in TeamCity

In this topic, you will learn how to set up a build steps for maven project in TeamCity.

As shown in below image, you have to select runner type as Maven. Then you have to provide the goals to be executed. By default, it uses POM.xml in the root directory of the project. You may also run code coverage process along with test goal which gives report on how many classes were covered by tests.

Here is the list of some of the popular maven goals that can be used.

  1. test – execute tests using surefire plugin. We can also pass various parameters to maven JUnit test goal  and maven testNG test goal
  2. verify – executes unit tests as well as does verification provided by plugins
  3. install
  4. site
  5. deploy
maven build step in TeamCity

maven build step in TeamCity

Below image shows that sample build log.

maven build log in TeamCity

maven build log in TeamCity


You may also like...