Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whitespace after XML comments removed since 3.1.0 release #209

Closed
Stephan202 opened this issue May 26, 2022 · 9 comments
Closed

Whitespace after XML comments removed since 3.1.0 release #209

Stephan202 opened this issue May 26, 2022 · 9 comments
Assignees

Comments

@Stephan202
Copy link
Contributor

Following resolution of #206, the the 3.1.x releases drop whitespace in one more case, namely after XML comments.

To reproduce, run:

git clone git@github.com:PicnicSupermarket/oss-parent.git
cd oss-parent
git checkout origin/master
mvn com.github.ekryd.sortpom:sortpom-maven-plugin:3.0.1:sort
git commit -m 'Before' pom.xml
mvn com.github.ekryd.sortpom:sortpom-maven-plugin:3.1.2:sort
git diff
@Ekryd
Copy link
Owner

Ekryd commented May 26, 2022

Hi! i will look into this

@Ekryd
Copy link
Owner

Ekryd commented May 26, 2022

<!-- The test JVMs are short-running. By disabling certain
            expensive JIT optimizations we actually speed up most tests. -->
            -XX:TieredStopAtLevel=1

to

<!-- The test JVMs are short-running. By disabling certain
            expensive JIT optimizations we actually speed up most tests. -->-XX:TieredStopAtLevel=1

I see, need to dig a little deeper

@Ekryd
Copy link
Owner

Ekryd commented May 26, 2022

WIth the new XML framework, text is always trimmed because it it placed within two elements.
In this case it is preceded by a comment, that always start at a new line.
This do create a strange mix of comments (that start on new lines) and text which is trimmed (so it stays on the same line).

Hmmm, how would we know that this text should be proceeded with a newline?

@Ekryd
Copy link
Owner

Ekryd commented May 26, 2022

I have found a way to always place text nodes, which have siblings (such as a comment), on their own line.
The problem is that I don't know if this is going to cause other problems in other pom files.
This behaviour may perhaps be toggled with some sort of parameter.

@Ekryd Ekryd self-assigned this May 26, 2022
@create-issue-branch
Copy link

@Ekryd
Copy link
Owner

Ekryd commented May 26, 2022

I have made an initial implementation in the branch. Feel free to play around with it and try to break it.

@Stephan202
Copy link
Contributor Author

@Ekryd Tnx for jumping on this so quickly! I built the branch and tested it against another internal repo: the results look exactly as expected 🎉

@Ekryd
Copy link
Owner

Ekryd commented May 28, 2022

Hi! Version 3.1.3 should solve your problem, try it and report how it works.

@Stephan202
Copy link
Contributor Author

Tnx for the rapid new release! The upgrade build against our internal repository passes 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants