Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JetBrains] Ensure prebuilt workspaces using Maven Wrapper are properly initialized in IntelliJ IDEA #14656

Merged
merged 1 commit into from
Nov 17, 2022

Conversation

felladrin
Copy link
Contributor

@felladrin felladrin commented Nov 14, 2022

Description

Currently, repositories using Maven Wrapper may fail to be loaded as a Maven Project if they are prebuilt with some specific file combination and then opened in JetBrains IntelliJ IDEA in Gitpod.

In summary:

  • When you use a prebuild of a repository containing a .xml file inside .idea folder, it won't load the Maven Projects correctly.
    You can see this behaviour by selecting Stable IntelliJ IDEA and starting a workspace from this URL.
  • There's no problem if the repository has no .idea folder.
    You can see this behaviour by selecting Stable IntelliJ IDEA and starting a workspace from this URL.
  • There's no problem if it has the files .idea/misc.xml, .idea/modules.xml, and .idea/spring-petclinic.iml.
    You can see this behaviour by selecting Stable IntelliJ IDEA and starting a workspace from this URL.
  • There's no problem if the workspace hasn't been prebuilt.

This PR reinitializes the Maven Project Manager after the IDE is loaded, so it overcomes the issue of Maven Project not being detected when JetBrains Client connects.

References:

Related Issue(s)

How to test

  1. Open the preview environment of this PR: https://ak-init-maven.preview.gitpod-dev.com/
  2. Select IntelliJ IDEA as your editor. It works for both Stable and EAP versions.
  3. Access the following URL to start the prebuild of a workspace using Maven Wrapper and not containing .idea folder: https://ak-init-maven.preview.gitpod-dev.com/#prebuild/https://github.com/gitpod-io/spring-petclinic/tree/felladrin/prebuilt-maven-project-without-iml-file
  4. Wait for the prebuild to finish and the workspace to start.
  5. Confirm if the IDE opens and the Sync of Maven Modules start automatically:
    image
  6. Confirm if Run Configurations works appropriately by clicking the Play / Debug icons:
    image image

(Optional) Extra tests you can run on this Preview Environment

  • Try a non-prebuilt workspace containing Maven Wrapper.
  • Try another IDE (e.g. PyCharm) to confirm this addition isn't affecting the IDE to load.
  • Try the empty repository.

Release Notes

[JetBrains] Fixed an issue preventing opening prebuilt Maven projects properly

Post-merge actions

Werft options:

  • /werft with-preview
  • /werft with-large-vm

@felladrin

This comment was marked as resolved.

@felladrin

This comment was marked as resolved.

@felladrin

This comment was marked as resolved.

@akosyakov

This comment was marked as resolved.

@felladrin felladrin changed the title [JetBrains] Force the initialization of Maven projects [JetBrains] Ensure projects using Maven Wrapper are always initialized Nov 15, 2022
@felladrin

This comment was marked as resolved.

@felladrin felladrin requested review from akosyakov and removed request for andreafalzetti November 15, 2022 09:41
@felladrin felladrin changed the title [JetBrains] Ensure projects using Maven Wrapper are always initialized [JetBrains] Ensure prebuilt workspaces using Maven Wrapper are properly initialized in IntelliJ IDEA Nov 15, 2022
@felladrin

This comment was marked as resolved.

to work around initialization after warmup in prebuilds

Co-authored-by: Victor Nogueira <[email protected]>
@felladrin

This comment was marked as resolved.

Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we tried together, and it seems to improve importing after prebuilds

@roboquat roboquat merged commit ca2876d into main Nov 17, 2022
@roboquat roboquat deleted the ak/init_maven branch November 17, 2022 13:56
@roboquat roboquat added deployed: IDE IDE change is running in production deployed Change is completely running in production labels Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: IDE IDE change is running in production deployed Change is completely running in production editor: jetbrains release-note size/M team: IDE
Projects
None yet
3 participants