I get the titled error when I use jvmarguments in the pom file. I'm using mvnw command with the below plugin to enable debugging. If I remove the jvm argument, it works. But I want to enable remote debugging with the mvnw command
Code Snippet:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>${start-class}</mainClass>
<executable>true</executable>
<fork>true</fork>
<jvmArguments>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005</jvmArguments>
</configuration>
</plugin>
Error:
*[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.7.RELEASE:run (default-cli) on project dxcgateway: Could not exec java: Cannot run program "C:\Program Files\Java\jdk1.8.0_202\jre\bin\java.exe": CreateProcess error=206, The filename or extension is too long -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.7.RELEASE:run (default-cli) on project dxcg ateway: Could not exec java
Caused by: java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.8.0_202\jre\bin\java.exe": CreateProcess error=206, The filename or extension is too long at java.lang.ProcessBuilder.start (ProcessBuilder.java:1048) at org.springframework.boot.loader.tools.RunProcess.run (RunProcess.java:77)
Caused by: java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.8.0_202\jre\bin\java.exe": CreateProcess error=206, The filename or extension is too long at java.lang.ProcessBuilder.start (ProcessBuilder.java:1048) at org.springframework.boot.loader.tools.RunProcess.run (RunProcess.java:77)*
I used the below commandand it worked. mvnw -Dmaven.repo.local=C:/mavenRepo