How to customize the Shorten Command Line method for an entire project in IntelliJ

When I run the tests, I get the error "The command line is too long." It works if I set the "Shorten the command line" method in the Run / Debug configuration to the "JAR manifest" for a particular method or class, but how to set it for the entire project or is there a global IDE setting for it?

+50
source share
3 answers

You can configure the default method for shortening the command line and use it as a template for future configurations by changing the default JUnit Run / Debug Configuration configuration template . Then all the new Run / Debug configurations that you create in the project will use the same option.

Here's the relevant blog post about a custom command-line abbreviation setting.

+32
source

Inside your .idea folder, modify the workspace.xml file

add

<property name="dynamic.classpath" value="true" />

at

  <component name="PropertiesComponent">
.
.
.
  </component>

example

 <component name="PropertiesComponent">
    <property name="project.structure.last.edited" value="Project" />
    <property name="project.structure.proportion" value="0.0" />
    <property name="project.structure.side.proportion" value="0.0" />
    <property name="settings.editor.selected.configurable" value="preferences.pluginManager" />
    <property name="dynamic.classpath" value="true" />
  </component>

If you don’t see it, feel free to add it yourself

 <component name="PropertiesComponent">
    <property name="dynamic.classpath" value="true" />
  </component>
+47
source

Intellij 2018.2.5

Run => Change configurations => Select a node on the left => expand Environment => Reduce command line parameters => select Classpath file or JAR manifest

Screen shot of Run / Debug Configuration showing the command line options

+15
source

Source: https://habr.com/ru/post/1691188/


All Articles