Set up a Spring Boot Remote Development Environment With JetBrains Gateway and Gitpod
Apr 28, 2022
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 🚀
Setting up your first Spring project using JetBrains Gateway and Gitpod
1. Setup
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
Preferences
from macOS application menu orSettings
fromFile
menu in Linux/Windows.Navigate to
Plugins
and 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 Gitpod
under 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 📖.
2. How to create a new Spring Boot project
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.
- Enter
https://github.com/gitpod-io/template-java-spring-boot-gradle
as the repository URL and click onNew Workspace
to start a new Gitpod workspace.
3. Run your project
Wait for the IDE to import the project and install the dependencies.
Run your project by clicking on the
Run
button. 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 browser
to 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.
Congratulations 🎉😄
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.
Setting up your existing codebase using JetBrains Gateway and Gitpod
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.
The .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 ✨
Customizing .gitpod.yml
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.
Working on Gitpod workspace using JetBrains Gateway
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. ✨
Last updated
Apr 28, 2022