Skip to content

Commit ca2876d

Browse files
akosyakovfelladrin
authored andcommitted
[jetbrains]: force initialize maven project
to work around initialization after warmup in prebuilds Co-authored-by: Victor Nogueira <victor@gitpod.io>
1 parent 460b87d commit ca2876d

File tree

4 files changed

+34
-2
lines changed

4 files changed

+34
-2
lines changed

components/ide/jetbrains/backend-plugin/gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ platformType=IU
1010
platformDownloadSources=true
1111
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
1212
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
13-
platformPlugins=Git4Idea, org.jetbrains.plugins.terminal, com.jetbrains.codeWithMe
13+
platformPlugins=Git4Idea, org.jetbrains.plugins.terminal, com.jetbrains.codeWithMe, org.jetbrains.idea.maven
1414
# Opt-out flag for bundling Kotlin standard library.
1515
# See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details.
1616
kotlin.stdlib.default.dependency=false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.
2+
// Licensed under the GNU Affero General Public License (AGPL).
3+
// See License-AGPL.txt in the project root for license information.
4+
5+
package io.gitpod.jetbrains.remote.optional
6+
7+
import com.intellij.openapi.diagnostic.thisLogger
8+
import com.intellij.openapi.project.Project
9+
import com.intellij.openapi.startup.StartupActivity
10+
import org.jetbrains.idea.maven.project.MavenProjectsManager
11+
12+
class GitpodForceUpdateMavenProjectsActivity : StartupActivity.RequiredForSmartMode {
13+
override fun runActivity(project: Project) {
14+
val mavenProjectManager = MavenProjectsManager.getInstance(project)
15+
16+
if (!mavenProjectManager.isMavenizedProject) return
17+
18+
mavenProjectManager.forceUpdateAllProjectsOrFindAllAvailablePomFiles()
19+
20+
thisLogger().warn("gitpod: Forced the update of Maven Project.")
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!--
2+
Copyright (c) 2022 Gitpod GmbH. All rights reserved.
3+
Licensed under the GNU Affero General Public License (AGPL).
4+
See License-AGPL.txt in the project root for license information.
5+
-->
6+
<idea-plugin>
7+
<extensions defaultExtensionNs="com.intellij">
8+
<backgroundPostStartupActivity implementation="io.gitpod.jetbrains.remote.optional.GitpodForceUpdateMavenProjectsActivity"/>
9+
</extensions>
10+
</idea-plugin>

components/ide/jetbrains/backend-plugin/src/main/resources/META-INF/plugin.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
<vendor>Gitpod</vendor>
1313
<description>Provides integrations within a Gitpod workspace.</description>
1414

15-
1615
<!-- Product and plugin compatibility requirements -->
1716
<!-- https://plugins.jetbrains.com/docs/intellij/plugin-compatibility.html -->
1817
<depends>com.intellij.modules.platform</depends>
18+
<depends optional="true" config-file="maven.xml">org.jetbrains.idea.maven</depends>
1919
<dependencies>
2020
<plugin id="Git4Idea"/>
2121
<plugin id="org.jetbrains.plugins.terminal"/>

0 commit comments

Comments
 (0)