You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/java/java-build.md
+21-40Lines changed: 21 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,48 +31,41 @@ Once a Maven project is loaded, the extension will be activated and it will auto
31
31
32
32
The Maven extension also supports searching Maven Central to resolve unknown types in your source code. You can do this by selecting the **Resolve unknown type** link shown on hover.
The extension provides code snippets and auto completion for adding Maven dependencies based on local Maven repositories. See how easy it is to add a new dependency to your `pom.xml` with those convenient features.
41
40
42
-
<videoautoplayloopmutedplaysinlinecontrolstitle="Add a new dependency to POM file">
You can also use the command **Maven: Add a Dependency** (or `maven.project.addDependency`) to help add a new dependency to `pom.xml`. The process is interactive.
53
50
54
-
<videoautoplayloopmutedplaysinlinecontrolstitle="Add a dependency">
<videosrc="images/java-build/maven-add-dependency-2.mp4"autoplayloopmutedplaysinlinecontrolstitle="Add dependency through project view">
62
57
</video>
63
58
64
59
Furthermore, VS Code also supports showing dependencies in a tree view, which allows you to inspect all dependencies in your project at a single place and check for potential issues.
The extension also preserves the history of goals for each project, so you can quickly rerun the previous command, which is useful when you're running a long custom goal.
@@ -82,26 +75,22 @@ There are two ways to rerun a goal:
82
75
1. In the Command Palette, run **Maven: History**, then select a project and a command from its history.
83
76
2. Right-click a project and select **History**. You can then select a previous command from history.
84
77
85
-
<videoautoplayloopmutedplaysinlinecontrolstitle="Run goals from Maven history">
<videosrc="images/java-build/maven-plugin-goal.mp4"autoplayloopmutedplaysinlinecontrolstitle="Easy way to access goals within each plugin">
99
89
</video>
100
90
101
91
To debug Maven goals, right-click on a goal and start debugging. The Maven extension will call the Java debugger with the right parameters. This is a handy, time-saving feature.
VS Code supports Gradle Java projects (excluding Android) through the [Gradle for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-gradle) extension. This extension offers several components to enhance your Gradle Java project experience:
132
-
-**Gradle Build Server:** The [Gradle Build Server](https://github.com/microsoft/build-server-for-gradle) is used to import gradle projects and delegate build tasks to the Gradle daemon, ensuring consistent project output as if running Gradle tasks from the command line.
119
+
-**Gradle Build Server:** The [Gradle Build Server](https://github.com/microsoft/build-server-for-gradle) is used to import Gradle projects and delegate build tasks to the Gradle daemon, ensuring consistent project output as if running Gradle tasks from the command line.
133
120
-**Visual Interface:** Allows you to view and manage Gradle tasks and project dependencies, and run Gradle tasks directly within VS Code.
134
121
-**Gradle Language Server:** Provides an improved authoring experience for Gradle build files, including syntax highlighting, error reporting, and auto-completion.
135
122
@@ -139,10 +126,9 @@ By default, if you have installed the Gradle for Java extension, the Gradle Buil
139
126
You can view the Gradle build output in the Build Server for Gradle (Build) output channel and trace the interactions between VS Code and the Gradle Build Server in the Build Server for Gradle (Log) output channel.
140
127
141
128
### Delegate tests to Gradle
142
-
The extension supports delegating the test execution to Gradle. You can configure the test profile you want to use in the Testing explorer.
129
+
The extension supports delegating the test execution to Gradle. You can configure the test profile you want to use in the Testing Explorer.
143
130
144
-
<videoautoplayloopmutedplaysinlinecontrolstitle="Delegate tests to Gradle">
<videosrc="images/java-build/delegate-test-to-gradle.mp4"autoplayloopmutedplaysinlinecontrolstitle="Delegate tests to Gradle">
146
132
</video>
147
133
148
134
> Note: Make sure you have installed the [Test Runner for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-test) extension to use this feature.
@@ -151,14 +137,12 @@ The extension supports delegating the test execution to Gradle. You can configur
151
137
152
138
When you open a Gradle project in VSCode, you can find some useful Gradle views by clicking the Gradle Side Bar item. **Gradle Projects** view lists all the Gradle projects found in the workspace. You can view, run, or debug Gradle tasks here.
When there are many Gradle tasks in the workspace, it might be hard to find a specific task. The extension offers a **Pinned Tasks** view to help you pin your favorite tasks so that you can easily find them in a separate view. You can also see recently executed tasks in the **Recent Tasks** view.
159
144
160
-
<videoautoplayloopmutedplaysinlinecontrolstitle="Pin a Gradle task">
<videosrc="images/java-build/gradle-pinned-recent-tasks.mp4"autoplayloopmutedplaysinlinecontrolstitle="Pin a Gradle task">
162
146
</video>
163
147
164
148
### Viewing Gradle dependencies
@@ -171,8 +155,7 @@ In the **Gradle Projects** view, you can find a **Dependencies** item under each
171
155
172
156
The **Gradle Daemons** view shows the daemon status of the current workspace. It lists all the running Gradle daemons in the same version as the workspace. You can choose to stop a specific one or all the daemons in this view.
@@ -193,14 +176,12 @@ If there is any syntax error (missing characters, type not found, etc.) in the o
193
176
194
177
The extension supports basic auto completions for a Gradle file, when you're trying to type Gradle closures or properties in a Gradle script, the extension will suggest available closures or properties for you.
195
178
196
-
<videoautoplayloopmutedplaysinlinecontrolstitle="Auto completion for Gradle file">
<videosrc="images/java-build/gradle-dependency-completion.mp4"autoplayloopmutedplaysinlinecontrolstitle="Auto completion for new dependency for Gradle">
0 commit comments