Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add maven capability to Team Services build agent

What's the correct way to setup maven on a Team Services Default build agent?

What I have done so far:

  • I have downloaded the agent on a virtual machine
  • I have manually installed java and maven on that machine (C:\Java\jdk1.8.0_101 resp C:\Java\maven\apache-maven-3.3.9)
  • I have added a few environment variables (maven, MAVEN_HOME, M2_HOME)
  • after that I install the agent using the powershel script .\config.cmd

The agent gets succesfully registered in my visualstudio.com environment, but the maven capability does not get picked up:

No maven capability

After reading several other posts, I manually added the "maven" capability to the agent:

manually added maven capability

After all this I can start a build that requires maven. But unfortunately the build fails:

Build fails

How do I get maven to work properly on my default build agent? I cannot find a solution in the MS documentation.

like image 621
Ron Avatar asked Oct 07 '16 20:10

Ron


1 Answers

To answer my own question. The mistake that I made was that I created the environment variables as user variables instead of system variables. To sum things up, here's what's needed:

  • download the agent on a virtual machine
  • installed java and maven on that machine
  • add SYSTEM environment variables M2_HOME and JAVA_HOME
  • install the agent using the powershel script .\config.cmd
like image 93
Ron Avatar answered Nov 10 '22 07:11

Ron