Invalid sorting on line break in artifactId value
See original GitHub issueSettings:
<plugin>
<groupId>com.github.ekryd.sortpom</groupId>
<artifactId>sortpom-maven-plugin</artifactId>
<version>2.13.1</version>
<configuration>
<keepBlankLines>true</keepBlankLines>
<createBackupFile>false</createBackupFile>
<expandEmptyElements>false</expandEmptyElements>
<sortModules>true</sortModules>
<sortDependencies>scope,groupId,artifactId</sortDependencies>
<sortProperties>true</sortProperties>
<sortPlugins>groupId,artifactId</sortPlugins>
<spaceBeforeCloseEmptyElement>false</spaceBeforeCloseEmptyElement>
</configuration>
</plugin>
Before sorting:
<dependency>
<groupId>foo.bar</groupId>
<artifactId>baz</artifactId>
</dependency>
<dependency>
<groupId>foo.bar</groupId>
<artifactId>
foo.bar.veryLongArtifactId
</artifactId>
</dependency>
After first sorting:
<dependency>
<groupId>foo.bar</groupId>
<artifactId>foo.bar.veryLongArtifactId
</artifactId>
</dependency>
<dependency>
<groupId>foo.bar</groupId>
<artifactId>baz</artifactId>
</dependency>
On restart:
<dependency>
<groupId>foo.bar</groupId>
<artifactId>baz</artifactId>
</dependency>
<dependency>
<groupId>foo.bar</groupId>
<artifactId>foo.bar.veryLongArtifactId
</artifactId>
</dependency>
But after formatting:
<dependency>
<groupId>foo.bar</groupId>
<artifactId>
foo.bar.veryLongArtifactId
</artifactId>
</dependency>
<dependency>
<groupId>foo.bar</groupId>
<artifactId>baz</artifactId>
</dependency>
Does not change on subsequent launches.
But baz I expect first.
Issue Analytics
- State:
- Created 2 years ago
- Comments:19 (10 by maintainers)
Top Results From Across the Web
'groupId' with value 'IOCProj1(Basic)' does not match a valid id ...
According DefaultModelValidator class 'artifactId' and 'groupId' have to match following regular expression. ID_REGEX = "[A ...
Read more >Make line breaks configurable (or preserve existing ... - GitHub
I have to replace all line break characters with the configured line breaks, otherwise strange things will happen when I write the sorted...
Read more >POM Reference - Maven
The purpose of this computation is to select a version that matches all the dependency declarations (due to transitive dependencies, there can be...
Read more >Configuring Logback with Spring Boot - CodinGame
Before we start looking at configuring Logback its worth having a quick ... %n - line break; %magenta() - sets the colour of...
Read more >Spring Initializr Reference Guide
Out-of-the-box, a custom instance handles command-line requests using cURL or HTTPie . ... initializr: group-id: value: org.acme artifact-id: value: my-app ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Released SortPom version 2.14.1 with the bug fix. Enjoy!!
So it is the google style plugin that reinserts the line breaks. No way around that unless you have shorter artifactIds.
But the other issue is a bug. Good job finding it! The dependencies should be sorted correctly on the first pass, I’ll get to it and try to solve it