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

Open
#360 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
java
Domain
build-system

Research direction

Reproduce the issue with the supplied pom.xml and run mvn help:effective-pom using Maven 4.0.0-rc5. Trace the effective-POM XML generation and namespace selection; done means the output uses the Maven 4.1.0 namespace and matching schema location when modelVersion is 4.1.0.

Written by the indexing model from the issue text.

Description

bug
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">
Dominant language
Java
Stars
29
Forks
42
Avg merge
23h 15m
Merged PRs (30d)
6

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/maven-help-plugin

All issues in apache/maven-help-plugin

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.