Issue
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:
After reading several other posts, I manually added the "maven" capability to the agent:
After all this I can start a build that requires maven. But unfortunately the build fails:
How do I get maven to work properly on my default build agent? I cannot find a solution in the MS documentation.
Solution
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
Answered By - Ron
Answer Checked By - Willingham (JavaFixing Volunteer)