Skip to content

Commit

Permalink
[jetbrains]: force initialize maven project
Browse files Browse the repository at this point in the history
to work around initialization after warmup in prebuilds

Co-authored-by: Victor Nogueira <[email protected]>
  • Loading branch information
akosyakov and felladrin committed Nov 17, 2022
1 parent cd144de commit 7c7f8c1
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/ide/jetbrains/backend-plugin/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ platformType=IU
platformDownloadSources=true
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
platformPlugins=Git4Idea, org.jetbrains.plugins.terminal, com.jetbrains.codeWithMe
platformPlugins=Git4Idea, org.jetbrains.plugins.terminal, com.jetbrains.codeWithMe, org.jetbrains.idea.maven
# Opt-out flag for bundling Kotlin standard library.
# See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details.
kotlin.stdlib.default.dependency=false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.
// Licensed under the GNU Affero General Public License (AGPL).
// See License-AGPL.txt in the project root for license information.

package io.gitpod.jetbrains.remote.optional

import com.intellij.openapi.diagnostic.thisLogger
import com.intellij.openapi.project.Project
import com.intellij.openapi.startup.StartupActivity
import org.jetbrains.idea.maven.project.MavenProjectsManager

class GitpodForceUpdateMavenProjectsActivity : StartupActivity.RequiredForSmartMode {
override fun runActivity(project: Project) {
val mavenProjectManager = MavenProjectsManager.getInstance(project)

if (!mavenProjectManager.isMavenizedProject) return

mavenProjectManager.forceUpdateAllProjectsOrFindAllAvailablePomFiles()

thisLogger().warn("gitpod: Forced the update of Maven Project.")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!--
Copyright (c) 2022 Gitpod GmbH. All rights reserved.
Licensed under the GNU Affero General Public License (AGPL).
See License-AGPL.txt in the project root for license information.
-->
<idea-plugin>
<extensions defaultExtensionNs="com.intellij">
<backgroundPostStartupActivity implementation="io.gitpod.jetbrains.remote.optional.GitpodForceUpdateMavenProjectsActivity"/>
</extensions>
</idea-plugin>
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
<vendor>Gitpod</vendor>
<description>Provides integrations within a Gitpod workspace.</description>


<!-- Product and plugin compatibility requirements -->
<!-- https://plugins.jetbrains.com/docs/intellij/plugin-compatibility.html -->
<depends>com.intellij.modules.platform</depends>
<depends optional="true" config-file="maven.xml">org.jetbrains.idea.maven</depends>
<dependencies>
<plugin id="Git4Idea"/>
<plugin id="org.jetbrains.plugins.terminal"/>
Expand Down

0 comments on commit 7c7f8c1

Please sign in to comment.