Apr 28, 2022
Set up a Spring Boot Remote Development Environment With JetBrains Gateway and Gitpod
Announcement 🚀 : Today, Gitpod and Jetbrains join forces to solve the ‘works on my machine’ problem. Bringing JetBrains’ deep product integration with Gitpod’s remote workspaces to developers around the world.
This gives developers the best of both worlds -
- Reproducible developer environments provisioned by Gitpod
- Favorite desktop IDE from Jetbrains - IntelliJ IDEA, PyCharm, GoLand, and PhpStorm
You can read the full announcement on our blog here.
JetBrains IDEs are one of the highly favored IDEs amongst developers. They provide excellent debugging and refactoring experience and built-in integrations with many tools such as docker, databases, web servers, etc. Through JetBrains Gateway, Gitpod delivers the choice of using JetBrains IDEs as a development environment for Gitpod workspaces. It will provide a familiar developer experience to long time users of JetBrains IDEs with the flexibility of cloud workspaces provided by Gitpod 🍊
This guide will teach you to set up a Spring project using JetBrains Gateway and Gitpod. Let’s get started 🚀
Gitpod JetBrains IDE integration is powered with JetBrains Gateway, a compact desktop app to connect to remote workspaces without installing an IDE.
Install JetBrains Gateway
Install Gitpod Plugin in JetBrains Gateway :
Gitpod provides a plugin that you can install in JetBrains Gateway to connect to and manage Gitpod workspaces.
Open JetBrains Gateway
Preferencesfrom macOS application menu or
Filemenu in Linux/Windows.
Pluginsand search for Gitpod in the Marketplace to find and install the Gitpod Gateway plugin.
Update your preferences on the Gitpod dashboard :
Select IntelliJ IDEA on the Gitpod preferences page. It will set IntelliJ IDEA as your default desktop IDE for future workspaces. This will launch an IDE window connected to your Gitpod workspace. You can also choose to use other JetBrains IDEs such as GoLand, PyCharm or PhpStorm.
Connect to your workspace from JetBrains Gateway :
Open JetBrains Gateway on your machine, and click
Connect to Gitpodunder the Gitpod section, connect to your workspace or create a new one from an existing repository.
If you want to read about the whole process in detail, you can refer to our online documentation 📖.
You can create a new Gitpod workspace using JetBrains Gateway with our Spring Boot template. This template uses Java 11 and Gradle and is configured for creating Gitpod workspaces.
- Launch JetBrains Gateway and navigate to the Gitpod tab.
https://github.com/gitpod-io/template-java-spring-boot-gradleas the repository URL and click on
New Workspaceto start a new Gitpod workspace.
Wait for the IDE to import the project and install the dependencies.
Run your project by clicking on the
Runbutton. IntelliJ IDEA starts your Spring application in the ‘Run window’.
Once the Spring application starts, IntelliJ IDEA will prompt you for the availability of port 8080. Click on the port and select
Forward and open in browserto launch the application in your web browser.
You can use the IntelliJ IDEA integrated terminal to run shell commands on your Gitpod workspace as well.
You have successfully set up your first Spring Boot project using Gitpod and JetBrains Gateway!
Further, if you want to learn more about running your existing codebase using Gitpod and JetBrains Gateway, you can follow the next section.
You can open an existing codebase using Gitpod and JetBrains Gateway. To get started with Gitpod, add a
.gitpod.yml file in the root directory of your existing codebase.
.gitpod.yml file at the root of your project is where you tell Gitpod how to prepare & build your project, start development servers and configure continuous prebuilds for GitHub.
Hence, improving the developer experience on Gitpod ✨
Here is the
.gitpod.yml, used in our template. It runs Gradle build when you open the workspace.
tasks: - init: ./gradlew build
You can change the command to build your application or add more commands to run when your workspace starts. You can also add plugins to install in your IDEA instance automatically.
To learn more about customizing
.gitpod.yml according to your requirements, refer to our documentation.
Using Gitpod on JetBrains Gateway feels like working on a project on a locally installed copy of IntelliJ IDEA. You can use the same shortcuts, powerful debugging tools, refactoring and plugins as you do on your local IDE without needing to set up your entire project on your machine.
This integration provides you with the best experience of using the cloud development environment of Gitpod and the comfort and familiarity of your JetBrains IDE. ✨