Build: Maven

Last Update: 9/26/2016

Team Services | TFS 2017 | TFS 2015 | Previous versions: XAML Build, Release

Build: Maven to build your Java code.

Demands

The build agent must have the following capability:

  • Maven

Arguments

Argument Description
Maven POM file

Relative path from the repo root to the Maven POM .xml file.

See Introduction to the POM.

Options Specify any Maven options you want to use.
Goal(s)

In most cases, set this to package to compile your code and package it into a .war file. If you leave this argument blank, the build will fail.

See Introduction to the Maven build lifecycle.

JUnit Test Results
Publish to Visual Studio Team Services/TFS Select this option to publish JUnit Test results produced by the Maven build to Visual Studio Team Services/TFS.
Test Results Files Test results files path. Wildcards can be used. For example, **/TEST-*.xml for all xml files whose name starts with TEST-."
Advanced
JDK Version Will attempt to discover the path to the selected JDK version and set JAVA_HOME accordingly.
JDK Architecture Optionally supply the architecture (x86, x64) of JDK.
Code Analysis
Run SonarQube Analysis Select if you want to run a SonarQube analysis. See The Maven build task now simplifies SonarQube analysis.
Run PMD Analysis Select if you want to perform a PMD static analysis. A build result page for each .pom file is shown on the Artifacts tab of the completed build. See The Maven build task now supports PMD analysis out of the box.
Control options

Example

Build and Deploy your Java application to an Azure web app

Q&A

Do I need an agent?

You need at least one agent to run your build or release. Get an agent.

I can't select a default agent queue and I can't queue my build or release. How do I fix this?

See queues.

I use Team Foundation Server on-premises and I don't see some of these features. Why not?

Some of these features are available only on Visual Studio Team Services and not yet available on-premises. Some features are available on-premises if you have upgraded to the latest version of TFS.