Visual Studio Team Services Support
Our friendly support bot is here to help!
We are here to help
How do I build Java with Maven?
Build your Java app with Maven
Team Services | TFS 2015 | Previous versions (XAML builds)After you've deployed an agent, you are ready to define a CI build that compiles your Java app with Maven whenever your team checks in code.
Upload your codeIf you haven't already, upload your code to GIT or TFVC.If you don't have any code, you can download our Hello world Java web app.What code is in the sample app?
Create the definition
- Create the build definition.
- Specify the code you want to build and select the continuous integration (CI) trigger.
- If your project builds with Maven, add the Maven build step. Otherwise add the build step your team uses.
- Provide the path to your Maven POM file.
- Select the continuous integration (CI) trigger and specify the code you want to build.
- Save the definition.
- Queue your new definition to make sure it works.
What code is in the sample app?We used Eclipse to create our Hello World Java sample web app. We adapted a project created from the maven webapp archetype.
The pom.xml file enables you to build with Maven. The .gitignore file keeps build artifacts on your dev machine from getting into your Git repo.
|-- .gitignore `-- helloworld |-- .classpath |-- .project |-- pom.xml `-- src `-- main `-- webapp |-- WEB-INF | `-- web.xml `-- index.jsp
Can I deploy my app to Azure?Deploy Java to Azure
What other kinds of apps can I build?Build your app
What other kinds of build steps are available?Specify your build steps
How do we protect our codebase from build breaks?
- Git: Improve code quality with branch policies with an option to require that code builds before it can be merged to a branch. This option is not available for GitHub repos.
- TFVC: Use gated check-in.
How do I modify other parts of my build definition?
- Specify your build steps to run tests, scripts, and a wide range of other processes.
- Specify build options such as building multiple configurations and creating work items on failure.
- Specify the repository to pick the source of the build and modify options such as how the agent workspace is cleaned.
- Set build triggers to modify how your CI builds run and to specify scheduled builds.
- Specify general build definition settings to specify how completed builds are named and change other options.
- Specify build retention policies to automatically delete old builds.