TeamCity Pipelines Help

Maven

The "Maven" Step type allows you to utilize Apache Maven to build projects.

Maven Step Settings

Goals

The sequence of space-separated Maven goals.

JDK

Allows you to select the required Java version. TeamCity lists a number of standard Java versions typically available on JetBrains-hosted agents.

Default Java options

By choosing any value, you point TeamCity to the required directory where the target Java is installed. For example, if you choose "Default", TeamCity will look in the directory whose path is stored in the env.JAVA_HOME parameter. Similarly, selecting "JDK 11 ARM64" points TeamCity to the directory stored in the env.JDK_11_0_ARM64 parameter.

If you want to explicitly specify a folder in which TeamCity should look for the required Java, choose "Custom" and enter your custom path.

Custom Java path

Note that you can use parameter references instead of absolute values.

POM Location

The path (relative to the working directory) to the Maven POM file. If this setting is not specified, TeamCity attempts to use the pom.xml file located directly in the root working folder.

Runner Arguments

The list of optional command-line parameters. The -q and -f parameters are ignored.

Maven Version

JetBrains-hosted TeamCity agents ship with multiple Maven versions. This setting allows you to choose a specific version for this Step.

Dependency Cache

A typical Maven project often needs to retrieve JAR dependencies from external sources, such as Maven Central, GitHub Package Registry, Azure Artifacts feeds, and others. The Enable Dependency Cache option available in the Optimizations section of Job Settings allows TeamCity to cache dependencies downloaded during the initial pipeline run. Subsequent runs can then reuse these cached dependencies instead of re-downloading them, significantly increasing the speed and cost-efficiency of your pipelines.

See this documentation section for more information: Optimizations: Dependency Cache.

Last modified: 18 September 2024