Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ Shorten Command Line for Cucumber Tests [duplicate]

I've encountered an issue running Cucumber tests in IntelliJ. When I try to run a feature or scenario, I get the following error:

"Error running 'Feature <feature>': Command line is too long. Shorten command line for Feature: <feature> or also for Cucumber java default configuration"

I know as part of IntelliJ's 2017.3 release, they added support for a "Shorten Command Line" option in the Run/Debug Configurations. However, if I compare the default configs, I don't see it as part of the Cucumber Java configuration, but I do see it in the JUnit configuration for example.

I don't get the popup tip that others have mentioned about the dynamic .classpath, I'm assuming because of this new release. Any ideas?

like image 375
DFW Avatar asked Jan 04 '18 16:01

DFW


2 Answers

If you edit IntelliJ's workspace.xml file to set the dynamic.classpath property to true, it will work.

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

I believe IntelliJ used to do this via a popup for you, but since the "Shorten Command Line" feature in 2017.3 has been added to the normal default Run/Debug configurations, it no longer does it this way. And since Cucumber for Java is a plugin, it must not know what to do in that scenario.

Hopefully the issue is fixed to add the dropdown: Shorten command line dropdown

Found some of the answer here: IDEA 10.5 Command line is too long

like image 57
DFW Avatar answered Oct 31 '22 08:10

DFW


Edit run configuration

Select JAR manifest in shorten command line

Select installed JRE not intelij SDK

Run now and it will work.

like image 24
Nirbhay Rana Avatar answered Oct 31 '22 08:10

Nirbhay Rana