mojohaus / tidy-maven-plugin

The Tidy plugin provides goals for tidying up your source code.
https://www.mojohaus.org/tidy-maven-plugin/
Apache License 2.0
21 stars 15 forks source link

POM version 4.1.0 gets (partly) rewritten back to 4.0.0 #106

Open sewe opened 4 months ago

sewe commented 4 months ago

A valid POM conforming to version 4.1.0 of the format and starting with

<project root="true" xmlns="http://maven.apache.org/POM/4.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.1.0 https://maven.apache.org/xsd/maven-4.1.0.xsd">
    <modelVersion>4.1.0</modelVersion>

gets rewritten to

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.1.0</modelVersion>

Essentially

  1. the namespace and schema URLs get changed to 4.0.0,
  2. attributes not part of the 4.0.0 model (project/@root) get removed,
  3. but the project/modelVersion curiously remains unchanged.

I would expect tidy:pom to preserve all of the original, except for possibly reordering attributes.