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

Add a set of Maven POM file TOs that are able to preserve file formatting and comments #10

Open
fabiocarvalho777 opened this issue Nov 2, 2017 · 0 comments

Comments

@fabiocarvalho777
Copy link
Member

fabiocarvalho777 commented Nov 2, 2017

Butterfly has one limitation when performing certain modifications to Maven pom files. Depending on the modification, it ends up modifying reformatting the whole file, changing indentation and the order of the tags. That happens because Butterfly reads the file, parses it, builds a model in memory, applies the transformation, then writes it back to the same file.

When it writes the file with the transformation, it uses the model in memory as source, which means it looses entirely the original formatting and comments the file used to have. Some users don't like it because many times the transformation is very trivial, and would change just a few lines, but still the result is a file that looks entirely different.

The goal of this issue is to create a new set of Maven POM file Transformation Operations that are able to perform isolated modifications, preserving formatting, order and comments by using StAX.

In addition to that, also undo the changes in this commit, uncommenting all unit tests that assure formatting and comments are preserved.

A few TOs have already been implemented using StAX, such as #84 and #92.

StAX references

@fabiocarvalho777 fabiocarvalho777 added this to the 2.3.0 milestone Jan 3, 2018
@fabiocarvalho777 fabiocarvalho777 changed the title Add a set of Maven POM file TOs that are able to preserve file formatting Add a set of Maven POM file TOs that are able to preserve file formatting and comments Jan 30, 2018
fabiocarvalho777 added a commit that referenced this issue Feb 3, 2018
Commenting out temporarily tests that assure TO that manipulate POM files preserve file formatting, indentation and comments.
These tests should be uncommented after issue #10 is complete.
@fabiocarvalho777 fabiocarvalho777 modified the milestones: 2.3.0, 2.4.0 Feb 19, 2018
@fabiocarvalho777 fabiocarvalho777 removed this from the 2.4.0 milestone Mar 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant