devonfw / IDEasy

Tool to automate the setup and updates of a development environment for any project (Successor of devonfw-ide).
Apache License 2.0
8 stars 23 forks source link

intellij does not use our settings when we create a new project within intellij #120

Open jan-vcapgemini opened 1 year ago

jan-vcapgemini commented 1 year ago

Expected behavior

As an intellij user I expect intellij to automatically load/import our settings when I create a new project within intellij.

Actual behavior

Currently if the user creates a new project within intellij. intellij will create a new configuration within the new project folder, ignoring our settings.

Steps to reproduce (bug) / Use Case of feature request (enhancement)

  1. Install a fresh devonfw-ide
  2. install intellij using: devon intellij
  3. Start intellij (should load main workspace with our settings)
  4. Create a new project within intellij in a subfolder of main
  5. Check the .idea and .intellij folders for our settings

Related/Dependent Issues

Comments/Hints:

A possible fix for that could be the "New Projects Setup" feature of intellij where we can set how new projects should be pre-configured. These settings can be exported and probably be added to our settings.

A workaround for this issue would be to manually create a new folder in workspaces and run: devon intellij create-script within the new folder e.g. (devonfw-ide/workspaces/mynewworkspace). The devonfw-ide will create a new start script inside the devonfw-ide folder named intellij-mynewworkspace.bat then. Make sure to disable INTELLIJ_DISABLE_OPEN_WORKSPACE within the .devon.properties to ensure that a new workspace will be opened in a new instance of intellij.

Affected version:

hohwille commented 11 months ago

INTELLIJ_DISABLE_OPEN_WORKSPACE should be active by default as IDEasy is a new product and should behave like this from the start. We can even decide to drop this property/variable and always have this behavior.

ndemirca commented 7 months ago

To export IntelliJ IDEA settings from one project and import them into a new project, you can follow these steps:

1. Export Settings from the Original Project: Install intelliJ using: devon intellij Start intelliJ (should load main workspace with our settings) Open the original project in IntelliJ IDEA. Go to File > Export Settings. Choose the settings you want to export. For our case all. Select the destination folder where you want to save the settings archive.

2. Create a New Project: Close the original project if it's still open. Restart intelliJ Create a new project by going to File > New > Project. Choose the project type and settings appropriate for your new project.

3. Import Settings into the New Project: Once the new project is created, go to File > Import Settings. Navigate to the folder where you saved the settings archive in step 1. Select the settings archive file (typically with a .zip extension). Click OK to import the settings. Restart intelliJ.

After importing the settings, it's recommended to restart IntelliJ IDEA for the changes to take effect!

4. Verify Settings: Check that the imported settings are applied correctly.

jan-vcapgemini commented 7 months ago

@ndemirca Thanks for your description of the export/import process of IDEA Settings. This looks like the manual process though, so now we need to check if these steps can be automated somehow.

ndemirca commented 7 months ago

@jan-vcapgemini Or New Projects Setup>Save Project As Template and the same approach like above would be also a similar solution but to automate this hole process there is more investigation needed.