Build Java projects with Team Foundation Server
The Teamprise Build Extensions add Java build capabilities to a Team Foundation Server build agent. They are provided free of charge under the license agreement and the source code is available under the Microsoft Public License (Ms-PL). The Build Extensions must be installed on the target build agent when creating a new build configuration from an Ant file or Maven 2 POM via a Teamprise client. However, it is not necessary for a Teamprise client to be installed to make use of these extensions. For more information please consult the User’s Guide (PDF).
Team Foundation Build is able to execute only MSBuild scripts to perform builds. Team Build creates a master build file, similar to a boot strap build file. The default Team Build scripts have some useful functionality for labelling, downloading source, updating work items, calculating changes and performing other tasks. For .NET based builds, the default script runs a child MSBuild process to build the .NET projects. The Teamprise Extensions for Team Foundation Build provide a custom MSBuild target and tasks that allow Ant or Maven 2 to be called from within the TFSBuild.proj file created by Team Build. When a new build definition is created by Teamprise-enabled clients, it is assumed that the Teamprise Extensions for Team Foundation Build are installed on all build agents on which the build definition may be run. These extensions may also be used without a Teamprise client.
Besides making the calling of Ant and Maven 2 easier, the Teamprise Extensions for Team Foundation Build report build data to TFS and publish the results of JUnit test runs. The Team Build portions of Team Foundation Server have undergone a major overhaul as part of TFS 2008; therefore there are two versions of the custom target: one for TFS 2005 and for TFS 2008.
The following components must be installed on the same server as the TFS Build Agent:
- Java JDK (the latest version from Sun is recommended)
- Maven 2 (if Maven support is required)
If the results of JUnit tests are to be published into Team Foundation Server, a Team Edition of Visual Studio Team Foundation Server must also be installed on the build agent to provide the "MSTest.exe" command-line executable and to enable the publish functionality.
Installing the Teamprise Extensions for Team Foundation Build
The Teamprise Extensions for Team Foundation Build consist of the following components:
- Teamprise.Build.Ant.targets file
- Teamprise.Build.Maven2.targets file
- Teamprise Build tasks assembly (Teamprise.Build.dll)
- JUnit transformation stylesheets
Due to the differences in the build functionality provided by TFS 2005 and TFS 2008, there are currently two versions of these, v1 for TFS2005 and v2 for TFS 2008. Note that Maven support is currently only provided for TFS2008.
Using the Installer
The easiest way to install the build extensions is to run the TeampriseBuildExtensions installer (msi) on the machine running the Team Foundation Build Server process (the build agent). This will install the necessary components into the MSBuild extensions path – usually located at %ProgramFiles%\MSBuild. It can also (optionally) install a private copy of Ant (v1.7.0) to perform the Ant builds.
A .zip archive for manual installation is also available. If using this method, the contents of the archive should be extracted to disk and then the contents copied to %ProgramFiles%\MSBuild\Teamprise.