For a long time Many developers thought of Mucrosoft as a closed environment. Visual Studio is designed to work best with .NET; however, Microsoft is putting in a lot of effort to make Team Foundation Server language agnostic. To that effort, they have built tools to allow Java developers to connect to TFS for source code, work item management, testing, and automated builds.
This article will walk through how to setup an automated build for your java apps using TFS.
Installing the Tools
Microsoft has developed a plug-in to Eclipse providing access to TFS. Though the plug-in is not quite at parity with Visual Studio, it is close.
To install the plug-in, follow the directions on this Microsoft page (http://msdn.microsoft.com/en-us/library/hh301122.aspx). Afterwards,
Connecting to TFS from Eclipse
The first step in connecting to TFS is to show the Team Explorer in the current perspective.
Next, click the Connect to Team Foundation Server link and provide the server information.
Creating the Build
To create the build, go to the builds section of the Team Explorer, and click
New Build Definition. You can then walk through the standard build definition wizard.
Set the source settings to point to the project in source control.
This step is the most important and only available from Eclipse, not Visual Studio. This one allows you to create a TFSBuild.proj for building Java projects. Click the Create to start.
You can then choose to build your java project based on your existing Ant or Maven build script.
The last option is to choose where the Java and Ant are installed. When building on an unknown build server, you can ship along these items through source control and have a better control on building your project.
Give it a try
By creating a build definition, you have just added a couple of files for msbuild. The TFSBuild.proj file and the TFSBuild.rsp file.
A simple right click on the build definition and you can start the java build process.