elharo opened a new pull request, #158:
URL: https://github.com/apache/maven-shared-jar/pull/158
Fixes #141
## Problem
`TextFileExposer` only read the first line of a version text file:
```java
String line = br.readLine();
if (line != null && !line.isEmpty()) {
textVersions.add(line);
}
```
Version files with multi-line content (e.g. `key=value` pairs, multi-line
version headers) lose all data beyond line 1.
## Fix
Read all lines in a loop:
```java
String line;
while ((line = br.readLine()) != null) {
if (!line.isEmpty()) {
textVersions.add(line);
}
}
```
## Test
Added `TextFileExposerTest` with two tests that build jars containing
multi-line version files and assert all lines are exposed. Both fail on the old
code (only first line returned) and pass with the fix.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]