You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "jafarre-bi (via GitHub)" <gi...@apache.org> on 2026/03/19 23:09:09 UTC

[I] AppendingTransformer generates undesired empty lines [maven-shade-plugin]

jafarre-bi opened a new issue, #798:
URL: https://github.com/apache/maven-shade-plugin/issues/798

   ### Affected version
   
   3.6.2
   
   ### Bug description
   
   I'm transforming the files META-INF/maven/org.apache.maven.api.di.Inject using the AppendingTransformer.
   After each merged file, it adds an empty line. From what I see in the code, it blindly adds a line feed after appending each file's contents, so it generates an empty line for each file that ends with a line feed. Unfortunately, maven-di tries to load empty entries, resulting in exceptions.
   I can think of two possible solutions:
   
   1. Only append a line feed if the last written character wasn't a line feed itself.
   2. Add an option that allows filtering out any empty lines.


-- 
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: issues-unsubscribe@maven.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] AppendingTransformer generates undesired empty lines that cause errors [maven-shade-plugin]

Posted by "efegokdemir (via GitHub)" <gi...@apache.org>.
efegokdemir commented on issue #798:
URL: https://github.com/apache/maven-shade-plugin/issues/798#issuecomment-5853242091

   Implemented in PR #862. AppendingTransformer now preserves an existing trailing line feed instead of adding a duplicate blank line, while still separating resources that do not end with one. Added regression coverage for both cases. Focused test and verify passed with Spotless/Checkstyle skipped because the local Palantir formatter is incompatible with the installed JDK; git diff --check passed.


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] AppendingTransformer generates undesired empty lines that cause errors [maven-shade-plugin]

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on issue #798:
URL: https://github.com/apache/maven-shade-plugin/issues/798#issuecomment-4110805074

   @gnodet I think MavenDI should just ignore empty (and commented out?) lines?
   
   @jafarre-bi Care to report this as Maven issue?


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] AppendingTransformer generates undesired empty lines that cause errors [maven-shade-plugin]

Posted by "jafarre-bi (via GitHub)" <gi...@apache.org>.
jafarre-bi commented on issue #798:
URL: https://github.com/apache/maven-shade-plugin/issues/798#issuecomment-4110972008

   @cstamas Shure thing. Yet, I think this opt-out is a good idea. It's a very simple change that can benefit other use cases where empty lines may cause problems.


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] AppendingTransformer generates undesired empty lines that cause errors [maven-shade-plugin]

Posted by "jafarre-bi (via GitHub)" <gi...@apache.org>.
jafarre-bi commented on issue #798:
URL: https://github.com/apache/maven-shade-plugin/issues/798#issuecomment-4109883638

   While writing a PR to fix this "bug", I realised it is documented behaviour. However, I think adding an opt-out for the newline separator allows us to use the AppendingTransformer in situations that disallow empty lines, like in my use case.
   I'd like to provide a PR with this opt-out. Any rules or guidelines I should take into account? Thank you.


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] AppendingTransformer generates undesired empty lines that cause errors [maven-shade-plugin]

Posted by "jafarre-bi (via GitHub)" <gi...@apache.org>.
jafarre-bi commented on issue #798:
URL: https://github.com/apache/maven-shade-plugin/issues/798#issuecomment-4110776241

   PR #802 adds the opt-out


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] AppendingTransformer generates undesired empty lines that cause errors [maven-shade-plugin]

Posted by "jafarre-bi (via GitHub)" <gi...@apache.org>.
jafarre-bi commented on issue #798:
URL: https://github.com/apache/maven-shade-plugin/issues/798#issuecomment-4111084056

   Related issue: https://github.com/apache/maven/issues/11827


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org