v5.16.0
(sdk version
)v11.0.16
(java -version
)v7.5.1
(gradle -version
)v3.8.6
(mvn -version
)We discuss how to set up a custom base image later in the guide.
sdk install <candidate> [version]
Important: Dynamically swapping Java, Maven or Gradle versions manually is a quick way to explore Gitpod. However, for day-to-day development strongly recommend to add explicit dependency versions in your gitpod.yml or Dockerfile.
sdk list java
- to see available java versionssdk install java 18.0.1.fx-zulu
- to install a specific versionsdk list maven
- to see available maven versionssdk install maven 3.8.6
- to install a specific versionsdk list gradle
- to see available gradle versionssdk install gradle 7.4.1
- to install a specific version.gitpod.yml
.gitpod.yml
.gitpod.Dockerfile
to install your dependency versionsgitpod.yml
and .gitpod.Dockerfile
.gitpod.Dockerfile
gitpod.io/#https://github.com/gitpod-io/gitpod
If your changes are not taking effect, ensure your workspace is building from the correct context, where yourSee configure Docker for more.gitpod.yml
orgitpod.Dockerfile
are checked in to version control and are on the branch or commit that you are opening.
.gitpod.yml
gp tasks
Tip: If you’re using VS Code Browser or VS Code Desktop, then your tasks will open as terminal windows. You can configure their layout using the openMode property.
We are using the init
property so that we can perform application building during a prebuild, for increased performance. We’ll discuss prebuilds more later on.
See start tasks and .gitpod.yml reference for more.
command
start task will run the start process on workspace start. With both VS Code Browser and VS Code Desktop, tasks are automatically opened in the terminal(s). With IntelliJ / JetBrains Gateway, configured tasks can be viewed by running gp tasks
in the workspace.command
for starting your application to your .gitpod.yml
gp tasks
gp env
, or in your repository and account settings.
See environment variables for more.
.gitpod.yml
to configure port 3000
to open in your browser on workspace start.
localhost
hostname to effectively run.
To ensure your localhost address works with Gitpod, you have two options:
localhost
references within the application with the output of gp url <port>
, typically via an environment variable.DEV_ENVIRONMENT_HOST
environment variable instead of localhost within the application, configured in the command
of the .gitpod.yml
start tasks.
.gitpod.yml
under vscode.extensions
.
.vscode/launch.json
file to version control. To use a launch configuration with Java, need Java version 11 or above, and some VS Code extensions. Assuming you have configured your base image with a compatible JDK version as described above, a simple way to get set up is by adding the Extension Pack for Java will configure the correct VS Code extensions. Alternatively, you can selectively choose the extensions to install.
.idea
folder contains lots of information used for IntelliJ (which can include sensitive information or secrets) you may wish to ignore the .idea
from version control, and explicitly allow .idea/runConfigurations
.
Add run/debug configurations to git, by adding the following to your .gitignore
.
.gitpod.yml
.
workspace
directory, any files stored outside of the workspace directory will be lost. For Java applications, we recommend to execute build commands within an init
startup task.
See prebuilds and start tasks for more.
.gitpod.yml
.
Example: Index both the stable and latest of the IntelliJ IDE
.m2
directory. However, since this location is by default outside of the /workspace
directory caches will not be stored as part of a prebuild.
If you are using the workspace-full image, Maven caching configuration is already enabled.
To configure Maven caching, add the following to your custom Dockerfile.
.m2
directory in the users (gitpod
) home directory.settings.xml
and configure localRepository
within workspace
.$USER_HOME/.gradle
, however, since this location is by default outside of the /workspace
directory caches will not be stored as part of a prebuild.
If you are using the workspace-full image, Gradle caching configuration is already enabled.
To configure Gradle caching, add the following to your custom Dockerfile.
.gitpod.yml
and Dockerfile
apply for all users using of the gitpod project. To apply personalisation, consider setting up dotfiles, the Gitpod Browser Extension,
Enable Settings Sync with Gitpod