TFS (Team Foundation Server) 2013 integrates into Maven build

Source: Internet
Author: User
Tags sonatype sonatype nexus

Team Foundation server is native to support cross-platform builds, including the Ant and Maven two build methods. By configuring the build server to connect to the TFS source code base, you can implement continuous integration builds, automatically detect code base health, and automate testing and deployment. This article takes Maven as an example of how to implement server building on the basis of TFS 2013.

1. Pre-conditions

-team Foundation Server

This article takes team Foundation Server 2013 as an example, and actually supports cross-platform server building from TFS 2010. You first need to install the TFS 2013 Server yourself before you perform the following operations. The process of installing a server is simple, and you can refer to the official MSDN documentation https://msdn.microsoft.com/zh-cn/library/vstudio/dd631902.aspx

-Java Development Kit (JDK) 1.8

The latest version of JDK is 1.8 and you can download it from here http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

-Maven 3.2.5

Currently the latest version is Maven 3.3.3, which is: https://maven.apache.org/download.cgi?Preferred=ftp://mirror.reverse.net/pub/apache/

However, during the trial, it was found that the latest version (3.3.3) was building the MAVEN project time, with the total hint "-dmaven.multimoduleprojectdirectory system propery is not set. Check $M 2_home environment variable and MVN script match." The bug, should be the flaw of this version, had to downgrade to version 3.2.5.

This error was reflected in the MSDN Forum, but no effective method was found, and the downgrade was a last resort.

https://social.msdn.microsoft.com/Forums/vstudio/en-US/47fdba6a-d6fc-4bed-9733-a68b577cd1a5/ Dmavenmultimoduleprojectdirectory-system-propery-is-not-set?forum=tee

-Eclipse LUNA

Eclipse is an important tool for TFS cross-platform development, with the ability to integrate team Explorer Everywhere,tfs in eclipse with Visual Studio.

The download path for Eclipse is http://www.eclipse.org/downloads/

and refer to the documentation for the MSDN installation of TFS plugin for Eclipse team Explorer Everywhere https://msdn.microsoft.com/en-us/library/vstudio/hh301122.aspx

2. Configure the build server

The build server for TFS can be deployed on the same machine as the TFS application-tier server, you can install the configuration independently, and then connect to the team project collection in TFS to provide build services for the group project in TFS. Here, for example, on the same platform.

2.1 Installing the TFS Build extension on the build server (TFS Build extentions)

TFS Build Extentions provides a dedicated user maven and Ant-built template for TFS that users can download from Microsoft Visual Studio Team Foundation Server Build Extensions:

https://visualstudiogallery.msdn.microsoft.com/2011f516-15a7-4f9a-8b86-1e0894a75739

2.2 Configuring the JDK and MAVEN environments

-Unzip the JDK and Maven to any folder on your computer

-Configure Server environment variables: java_home, M2_home

-Add the bin path of the JDK and maven to the "path" of the environment variable

-Verify that the MAVEN and Java environments are configured correctly by running the command "Java–version" and "Mvn-v"

If the intranet environment deploys a MAVEN server (for example, Sonatype Nexus Http://www.sonatype.com/nexus), you can modify the MAVEN configuration file and set the mirror address to increase the download speed of the dependent libraries. Also solve the problem that the build server cannot connect to the Internet. such as

3. Create a sample project with Eclipse and upload it to the TFS code base

Before using Eclipse to create a MAVEN project, if you need to use the MAVEN configuration of the local specification, you also need to set the parameters for Eclipse, such as (in an environment where you can connect to the Internet, you can ignore this step):

Maven Sample Project Creation succeeded

4. Configure the build definition and validate the build environment

Upload the Java project you created in the previous step to the TFS server. and use the tee configuration to build the definition.

Run the build definition

Build Success!

Http://www.cnblogs.com/danzhang Zhang Hongjun

TFS (Team Foundation Server) 2013 integrates into Maven build

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.