Skip to content

Namespace is http://maven.apache.org/POM/4.0.0#799

Open
elharo wants to merge 3 commits into
masterfrom
fix
Open

Namespace is http://maven.apache.org/POM/4.0.0#799
elharo wants to merge 3 commits into
masterfrom
fix

Conversation

@elharo

@elharo elharo commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates POM XML namespace emission in PomWriter to use the canonical Maven 4.0.0 namespace URI, ensuring generated POMs declare the standard namespace.

Changes:

  • Hardcode the POM XML namespace to http://maven.apache.org/POM/4.0.0.
  • Update the schemaLocation attribute’s namespace portion to match http://maven.apache.org/POM/4.0.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/java/org/apache/maven/plugins/shade/pom/PomWriter.java
root.setAttribute(
"schemaLocation",
"http://maven.apache.org/POM/" + modelVersion + " http://maven.apache.org/maven-v"
"http://maven.apache.org/POM/4.0.0" + " http://maven.apache.org/maven-v"

Copilot AI Mar 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This concatenation joins two string literals (".../4.0.0" + " http://...") which is harder to read than a single literal. Collapsing it into one string (or building it from constants) would improve readability.

Suggested change
"http://maven.apache.org/POM/4.0.0" + " http://maven.apache.org/maven-v"
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v"

Copilot uses AI. Check for mistakes.
@elharo

elharo commented Mar 20, 2026

Copy link
Copy Markdown
Contributor Author

FYI CI looks broken:

Error: Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.43.0:check (default) on project maven-shade-plugin: Execution default of goal com.diffplug.spotless:spotless-maven-plugin:2.43.0:check failed: An API incompatibility was encountered while executing com.diffplug.spotless:spotless-maven-plugin:2.43.0:check: java.lang.NoSuchMethodError: 'java.util.Queue com.sun.tools.javac.util.Log$DeferredDiagnosticHandler.getDiagnostics()'

@slawekjaranowski

Copy link
Copy Markdown
Member

@elharo did you rebase your branch with the latest master version?

@elharo

elharo commented Mar 21, 2026

Copy link
Copy Markdown
Contributor Author

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants