Clone an Azure DevOps Services Git repo using IntelliJ
TFS 2018 | TFS 2017 | TFS 2015
In this exercise, you are going to open the MyShuttle2 repo from your organization in your VM for editing in IntelliJ.
Note
These Hands-On Labs use a virtual machine with a Java environment configured by our partner, Northwest Cadence.
Prerequisites
This exercise assumes you have completed the Azure DevOps Services Java project setup tutorial, have created a Team Project that uses Git for version control, and imported the MyShuttle2 GitHub repo into your team project. This exercise uses a team project named jdev, though your team project name may differ.
Connect to Azure DevOps Services from IntelliJ
Click on the IntelliJ icon in the toolbar to open IntelliJ IDEA.
The first time you run IntelliJ, it will prompt for IntelliJ settings and theme settings. Click on "Do not import settings," then click on "Skip All and Set Defaults" to use the defaults.
When the Welcome dialog appears, click Configure and then select Plugins.
In the search box type
Azure DevOps Services
and click the "Search in repositories" link in the main window.Click install to install the extension. The install button will change to a "Restart" button - click it to restart IntelliJ.
When IntelliJ restarts, the Welcome dialog will appear again. Click "Check out from Version Control" and select "Azure DevOps Services Git".
Click on "Sign in..." to sign in to your organization.
Clone MyShuttle2 from Azure DevOps Services with IntelliJ
Once you have authenticated, enter "MyShuttle2" into the search bar and select the MyShuttle2 repo from your team project. Click the Clone button to clone the repo to the VM.
IntelliJ detects a Maven project file (pom.xml) and asks if you want to open it. Click "Yes" to open the project. You can dismiss the Tip of the Day dialog that appears.
Press "Alt-1" to open the Project View.
Expand
src\main\java\com.microsoft.example
and click on "DataAccess" to open the DataAccess class.A yellow warning appears in the main editor window prompting you to "Setup SDK". Click on the link.
In the Select Project SDK dialog, click "Configure..."
In the upper left, click the green "+" icon to add a new SDK.
Select
java-8-openjdk-amd64
from the folder list and click OK. Click OK back through the rest of the dialogs.Note
The project will not currently compile, since it has a dependency on a library (MyShuttleCalc) that it cannot resolve. You will fix this in the Package Management lab.
Clone MyShuttleCalc from Azure DevOps Services with IntelliJ
While the MyShuttle2 project is open in IntelliJ, in the toolbar at the top of IntelliJ, select File -> New -> Project from Version Control -> Azure DevOps Services Git.
Enter "MyShuttleCalc" into the search bar and select the MyShuttleCalc repo from your team project. Click the Clone button to clone the repo to the VM.
IntelliJ will prompt to open the project in the same or a new window. Choose "New Window" to open another instance of IntelliJ with the MyShuttleCalc project.
IntelliJ should open in a new instance with the project loaded.