Any JUnit run/debug execution fails immediately with Error: could not open {argLine}

Answered

/scratch/jdk-9.0.1.jdk/Contents/Home/bin/java -ea @{argLine} -Xmx1024m -Dfile.encoding=UTF8 @{argLine} -Xmx1024m -Dfile.encoding=UTF8 [...]
Error: could not open `{argLine}'

This started happening suddenly, for no apparent reason. I re-opened the project, restart, and upgraded to the latest (see below), all with the same error.

Doesn't matter what test I try to run.

Version

IntelliJ IDEA 2017.3.4 (Ultimate Edition)
Build #IU-173.4548.28, built on January 29, 2018
Licensed to Oracle

JRE: 1.8.0_152-release-1024-b11 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.11.6

1
3 comments
Avatar
Permanently deleted user

I've also rebooted.

I also saw and tried the various "Shorten command line" options in the configurations. I had never seen this before, but am guessing that the issue I'm seeing is tied to this feature, and would appear to be a bug.

0
Avatar
Permanently deleted user

Found it. Someone had added this into a parent pom.xml, and while maven clearly understands how to deal with this, apparently IntelliJ doesn't:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<!-- for convenience reasons, 'argLine' should not be overridden in child poms.
if needed, a property failsafe.argLine should be overridden; if not, profile 'sonar' may
stop working -->
<argLine>@{argLine} ${surefire.argLine} ${surefire.coverage.argline}</argLine>
</configuration>
</plugin>
0

Indeed such arguments are not parsed by IDE. Please vote and follow this issue: https://youtrack.jetbrains.com/issue/IDEA-143187

0

Please sign in to leave a comment.