OpenLiberty / liberty-tools-intellij

IntelliJ IDEA extension for Liberty
https://plugins.jetbrains.com/plugin/14856-open-liberty-tools
Eclipse Public License 2.0
12 stars 24 forks source link

Fix for Liberty Start issue in directory with space in name #853

Closed vaisakhkannan closed 1 month ago

vaisakhkannan commented 3 months ago

Fixes #690 Fixed Liberty Start issue in directories with spaces in their names. During my investigation, I found that the problem occurs only with Gradle projects, and there are no issues with Maven projects. I wrote tests for Gradle projects that cover cases with spaces in app names and directory names. Similarly, I wrote tests for Maven projects that cover cases with spaces in directory names. We can't use spaces in app names with Maven projects, as this will result in an error in the pom.xml file stating that the value of the artifactId does not match the id pattern.

Screenshot 2024-07-01 at 4 21 05 PM

The problem will occur with both Liberty: Start and Liberty: Start in Container. I have written tests only for Liberty: Start. If required, I can add tests for the other scenario.

I have added a new sample project because we can't use the existing projects. We need a project with a space in its name (only for Gradle) and a space in the directory name. So, I created another directory with a space in its name.

I have checked the tests to see whether they will fail (based on whether Liberty starts or not). If the bug in the issue still exists, the gradle test will fail(No such file or directory error, resulting in Liberty:Startaction failure, for maven there is no issue with the directory that getting ,and the functionality in gradle wrapper and maven wrapper are slightly different. In maven wrapper we get a command like "./mvnw" but in gradle wrapper , it will get path of the project aswell , that's the reason behind the failure in gradle only), otherwise, it will succeed.

Screenshot 2024-07-02 at 1 49 59 PM

Test failure in Maven projects depends on how the Liberty:Start action performs. If Liberty:Start fails, it will result in a failure error.

The failure results in both the cases are same as shown in the screenshot above

aparnamichael commented 2 months ago

@vaisakhkannan Please modify the year in header of all the modified files.

vaisakhkannan commented 1 month ago

@aparnamichael , @turkeylurkey This is a screen recording showing how the exception occurs when trying to access an invalid file.

https://github.com/user-attachments/assets/bbb35c4d-592e-4d7c-82c7-9a554540032a