Comments (11)
Why not keep this issue open to be able to fix it someday in the next major release?
from sortpom.
I use a library called Jdom to parse the XML, and I think that this library doesn't support the concept of line numbers. I look into this further, but the chances are slim.
from sortpom.
The plugin works like this for verification:
- The pom.xml is parsed by the JDOM library into an element structure. That library does not store the line numbers for the elements.
- The plugin sorts the element structure
- The plugin traverses both the original element structure and the sorted element structure. For each pair of elements the plugin checks if the elements and the content are the same.
- When the two elements differ, the plugin writes an error message.
The problem is that the element structure does not have access to the line number. I could try to locate the elements in the original file by using a line by line string comparison, but I cannot be certain that I get a unique match or even that I get a match at all (if element start or end is on separate lines).
Sometimes the line number indication would point to the wrong line and sometimes it would be missing.
Would it help you to get a line number that you could not trust?
from sortpom.
I'm surprised that library didn't have information about line numbers. Is it something JDOM-specific or all the libraries have the same behavior?
from sortpom.
It is JDOM specific. It is an old library (think Java 1.4) and I don't have the time to change xml parsing library. Some of the plugin functionality is now directly dependent on that version of that library.
Not very good design and I can only say that I would have done differently today than in 2009 :-/
from sortpom.
Sorry mate, it won't happen. I don't have time to rewrite the plugin from scratch. It is no idea to keep issues open if I can't fix them within reasonable time.
from sortpom.
But others could see what can be done and might offer a pull request...
from sortpom.
To rewrite the plugin from scratch :-D
I'm not even sure that I would like that (it's my baby!!).
How about if I create a wiki page that collects issues (epics) that can only be done sometime in the future?
from sortpom.
Sorry to say, but if you don't like it than do not make it open source ;-( But of course a wiki pages which collects issues like this would be another good idea...Or just assign the issues to an appropriate milestone like 3.0 ?
from sortpom.
Sorry to say, but if you don't like it than do not make it open source ;-(
@Ekryd did a good job by creating this plugin and it's ok that he doesn't want to accept some PRs because of some reason. Actually it's good that he said it as-is right now. It just means that if someone wants to implement it, he/she should fork this project instead of creating a PR here.
from sortpom.
Of course a fork is also a reasonable solution.
from sortpom.
Related Issues (20)
- Xml formatting HOT 12
- sorting doesn't work in >=v3.0.0 HOT 11
- no sort xmls with doctype HOT 4
- Add entry for the 3.2.1 release on the wiki page `Versions` HOT 2
- Tone down sortpom output HOT 6
- Properties configuration Suggestion HOT 7
- Setting to disable pom sorting? HOT 4
- LATEST using in pom is deprecated and will be removed from maven 4 HOT 8
- Handle plugin warnings HOT 1
- Dependency Dashboard
- Setup Maven 4 build pipe HOT 1
- Preserve formatting inside project element HOT 9
- Add configuration to suppress XML declaration HOT 7
- Add configuration for newline at the end of file HOT 6
- XML tag with `xml:space="preserve"` containing only spaces should not be collapsed HOT 4
- Attributes resulting in long lines should be wrapped or chopped down HOT 10
- Revisit schema location indent choice HOT 11
- Java Class File Version 52+ ( 55=Java 11 and/or 61=Java 17)
- Newlines aren't kept at beginning or end of String content. HOT 4
- Not sorting with mvn comand HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sortpom.