Skip to content

help:effective-pom outputs wrong XML namespace when modelVersion is 4.1.0 #360

@hboutemy

Description

@hboutemy

Affected version

3.5.1

Bug description

using pom.xml

<project xmlns="http://maven.apache.org/POM/4.1.0">
    <groupId>com.example</groupId>
    <artifactId>parent</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <description>modelVersion = ${project.modelVersion}</description>
</project>

with Maven 4.0.0-rc5 (and earlier in alpha):

$ mvn help:effective-pom
[INFO] Scanning for projects...
[INFO] 
[INFO] --------------------------------------------------< com.example:parent >--------------------------------------------------
[INFO] Building parent 1.0.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] ---------------------------------------------------------[ jar ]----------------------------------------------------------
[INFO] 
[INFO] --- help:3.5.1:effective-pom (default-cli) @ parent ---
[INFO] 
Effective POMs, after inheritance, interpolation, and profiles are applied:

<?xml version="1.0" encoding="UTF-8"?>
...
<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>
  <groupId>com.example</groupId>
  <artifactId>parent</artifactId>
  <version>1.0.0-SNAPSHOT</version>
  <description>modelVersion = 4.1.0</description>

should be:

<project 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">

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions