question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sortpom wrongly reports the xml element <artifactId>

See original GitHub issue

I have a pom file dependency:

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-web</artifactId>
</dependency>

There are no issues reported. But as soon as I add an exclusions block to it:

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-web</artifactId>
  <exclusions>
    <exclusion>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-tomcat</artifactId>
    </exclusion>
  </exclusions>
</dependency>

sortpom complains:

--- sortpom-maven-plugin:2.8.0:verify (default) @ project ---
Verifying file /home/user/Repos/project/pom.xml
The xml element <artifactId> should be placed before <groupId>
The file /home/user/Repos/project/pom.xml is not sorted

I believe the pom file is actually sorted correctly. I have checked the exclusion example in the maven official guide and it got groupId placed before the artifactId

sortpom doesn’t complain about this block

<parent>
  <artifactId>spring-boot-starter-parent</artifactId>
  <groupId>org.springframework.boot</groupId>
  <version>2.0.4.RELEASE</version>
  <relativePath></relativePath>
</parent>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
vimal4davidcommented, Sep 21, 2018

@Ekryd - Thanks for the prompt fix. The problem is solved.

1reaction
Ekrydcommented, Sep 21, 2018

Please have a look at the 2.9.0 version of SortPom. The problem should be solved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sort Reporting Plugins · Issue #17 · Ekryd/sortpom - GitHub
The element it is placed under configuration which is sort of a free-text area. So if you want to sort the reportPlugins, you...
Read more >
Maven pom sorting issue - Stack Overflow
Currently ,I have placed the modelversion before parent but still ,I am seeing the same error . Pom: <?xml version="1.0" encoding="UTF-8"?> ...
Read more >
Maven-SortPom-Plugin - Google Code
xml file if the xml elements are unsorted. This goal ignores text formatting (such as indentation and line breaks) when it verifies if...
Read more >
POM Reference - Maven
It is an XML representation of a Maven project held in a file named pom.xml ... This is a listing of the elements...
Read more >
553583 – Misleading validation error in pom.xml - Bugs - Eclipse
Eclipse shows the following error for my pom.xml: The element type ... However, this error is wrong and misleading, because the dependency-tag is ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found