gnodet commented on issue #314:
URL: 
https://github.com/apache/maven-resources-plugin/issues/314#issuecomment-5829406934

   After investigation, this is not a bug in the plugin or in maven-filtering.
   
   The filtering pipeline faithfully preserves the source file's content byte 
for byte — it does not add any characters that are not already present in the 
source.
   
   A quick empirical test with Maven 3.9.16 + maven-resources-plugin 3.3.1 
confirms:
   - Source `${java.version}` **without** trailing newline → output `21.0.3` 
**without** trailing newline
   - Source `${java.version}` **with** trailing newline → output `21.0.3\n` 
**with** trailing newline
   
   The trailing `\n` seen in the filtered output was already present in the 
source file. Most text editors (vim, nano, VSCode, IntelliJ, etc.) 
automatically append a final newline to text files as per POSIX convention, 
which can be easy to miss.
   
   If you need a file that contains only a bare value with no trailing newline, 
create it explicitly:
   ```
   printf '${java.version}' > src/main/features/version.txt
   ```
   
   Closing as not a bug.


-- 
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]

Reply via email to