marklogic / ml-gradle

Gradle plugin for automating everything involving MarkLogic
Other
72 stars 78 forks source link

ml-gradle doesn't trim whitespaces at the end of env properties #723

Open rishabh208gupta opened 5 days ago

rishabh208gupta commented 5 days ago

Please use the debugging guide first to see if you can identify the problem - https://github.com/marklogic/ml-gradle/wiki/Debugging-guide . That addresses the most common bugs, such as not being able to load modules, or getting any error when deploying a particular resource, or getting any error with one of the data movement asks.

Describe the bug ml-gradle doesn't trim whitespaces at the end of env properties.

To Reproduce Steps to reproduce the behavior:

  1. have a property in gradle.properties file with a whitespace at the end.

Expected behavior The whitespace at the end should be trimmed.

rjrudin commented 5 days ago

Hi @rishabh208gupta - which property did you run into with this behavior? ml-gradle does trim each property value that it reads - for example, I can add a space at the end of mlUsername and mlPassword that space will be trimmed.

But while looking into this, I noticed that when ml-gradle builds a forest name for a new database, the space will be trimmed from the database name but will not be trimmed from the forest name, leading to an error. So this problem may be specific to token values that are replaced in resource files, where the token value is not being trimmed.