Skip to content

Maven 4 rejects POM when xmlns:xsi uses HTTPS #11693

@hazendaz

Description

@hazendaz

Affected version

4.0.0-rc-5

Bug description

In Maven 3, I can change the xmlns:xsi namespace to use HTTPS instead of HTTP. I do this deliberately so automated scans can detect potential HTTP usage without triggering false positives for the canonical Maven POM namespace. The release plugin in Maven 3 provides a flag <addSchema>false</addSchema> to ignore this change, which has worked reliably for years.

In Maven 4, however, the same POM fails with:

org.apache.maven.api.services.xml.XmlReaderException: Unable to read model: Unknown attribute 'schemaLocation' for tag 'project'

Example POM snippet that is valid in Maven 3:

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

Problem:
Maven 4 is stricter in validating the xsi:schemaLocation attribute and does not allow the xmlns:xsi to use HTTPS. This breaks valid XML and creates unnecessary friction for teams trying to avoid HTTP usage in code audits. There is no flag or property in maven.config to bypass this validation, unlike Maven 3’s workaround with the release plugin.

Proposed improvement:
Maven should allow xmlns:xsi to use either http or https while still validating the POM, or provide a global flag in maven.config that disables strict schema validation for the POM entirely. This would:

  1. Reduce false positives when scanning for HTTP URLs.
  2. Maintain backward compatibility for teams using HTTPS namespaces.
  3. Avoid requiring widespread removal or modification of xsi:schemaLocation in hundreds of POMs.

note: the namespace is still allowed to be https with maven 4. Only xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" is a problem.

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