0

I know how to set "Shorten command line" for specific configurations (eg a specific JUnit test configuration) and for specific configuration templates (eg for all new JUnit test configurations). Is it possible to configure IntelliJ IDEA to default to a specific setting (ie something set in ~/.IntelliJIdea*) such that ALL configurations (eg JUnit, Cucumber, Spring Boot, etc) default to using that default method?

Noel Yap
  • 18,822
  • 21
  • 92
  • 144
  • 1
    There is no global setting to control it, only [per project](https://stackoverflow.com/questions/4853540/what-does-the-dynamic-classpath-flag-do-intellij-project-settings). – CrazyCoder Sep 25 '19 at 18:24

1 Answers1

0

I haven't found a way to set it for all configuration types but there is a way to set it as an IDEA default for specific configuration types.

First, in ~/.IntelliJIdea*/config/options/project.default.xml, create a <component name="ProjectManager"><defaultProject><component name="RunManager">…</component></defaultProject></component> element if it doesn't already exist.

Then, for each configuration type to be defaulted:

  1. Set a project default in a template for that configuration type in an existing project.
  2. In that project's .idea/workspace.xml file, copy the <configuration>…</configuration> element inside the <component name="RunManager">…</component> element for that configuration type.
  3. Paste that block into ~/.IntelliJIdea*/config/options/project.default.xml inside <component name="ProjectManager"><defaultProject><component name="RunManager">…</component></defaultProject></component>.

Restart IntelliJ IDEA so all instances pick up the new defaults and don't overwrite project.default.xml thereby wiping out the settings.

Save project.default.xml in case exiting IntelliJ IDEA overwrote the modifications.

Noel Yap
  • 18,822
  • 21
  • 92
  • 144