Skip to content

Commit ecb13e3

Browse files
committed
Force update of Maven Modules when project opens, by using a listener
1 parent 88585f3 commit ecb13e3

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
// Licensed under the GNU Affero General Public License (AGPL).
33
// See License-AGPL.txt in the project root for license information.
44

5-
package io.gitpod.jetbrains.remote.maven
5+
package io.gitpod.jetbrains.remote.optional
66

77
import com.intellij.openapi.project.Project
88
import org.jetbrains.idea.maven.project.MavenProjectsManager
99
import com.intellij.openapi.diagnostic.thisLogger
10+
import com.intellij.openapi.project.ProjectManagerListener
1011

11-
class GitpodMavenProjectManager(project: Project) {
12-
13-
init {
12+
class GitpodMavenProjectManagerListener : ProjectManagerListener {
13+
@Deprecated("Deprecated. Need to findout the best way to replace it")
14+
override fun projectOpened(project: Project) {
1415
thisLogger().warn("gitpod: forcing initialization of maven project")
1516
MavenProjectsManager.getInstance(project).forceUpdateAllProjectsOrFindAllAvailablePomFiles()
1617
thisLogger().warn("gitpod: forced!")
1718
}
18-
1919
}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@
55
-->
66
<!--suppress PluginXmlValidity -->
77
<idea-plugin>
8-
<depends optional="true">org.jetbrains.idea.maven</depends>
98
<extensions defaultExtensionNs="com.intellij">
109
<applicationService serviceInterface="io.gitpod.jetbrains.remote.GitpodIgnoredPortsForNotificationService" serviceImplementation="io.gitpod.jetbrains.remote.latest.GitpodIgnoredPortsForNotificationServiceImpl" preload="true"/>
1110
<applicationService serviceInterface="io.gitpod.jetbrains.remote.GitpodCLIHelper" serviceImplementation="io.gitpod.jetbrains.remote.latest.GitpodCLIHelperImpl"/>
1211
<applicationService serviceInterface="io.gitpod.jetbrains.remote.GitpodPortForwardingService" serviceImplementation="io.gitpod.jetbrains.remote.latest.GitpodPortForwardingServiceImpl" client="controller" preload="true"/>
1312
<projectService serviceImplementation="io.gitpod.jetbrains.remote.GitpodClientProjectSessionTracker" client="controller" preload="true"/>
1413
<projectService serviceImplementation="io.gitpod.jetbrains.remote.GitpodTerminalService" client="controller" preload="true"/>
15-
<projectService serviceImplementation="io.gitpod.jetbrains.remote.maven.GitpodMavenProjectManager" client="controller" preload="true"/>
1614
</extensions>
1715
<actions>
1816
<action id="io.gitpod.jetbrains.remote.latest.GitpodCopyUrlAction"

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
-->
66
<!--suppress PluginXmlValidity -->
77
<idea-plugin>
8-
<extensions defaultExtensionNs="com.intellij">
9-
<projectService serviceImplementation="io.gitpod.jetbrains.remote.maven.GitpodMavenProjectManager" preload="true"/>
10-
</extensions>
8+
<applicationListeners>
9+
<listener class="io.gitpod.jetbrains.remote.optional.GitpodMavenProjectManagerListener"
10+
topic="com.intellij.openapi.project.ProjectManagerListener"/>
11+
</applicationListeners>
1112
</idea-plugin>

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

Lines changed: 1 addition & 1 deletion
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)