Sitelet https://github.com/apache/maven/issues/10939
Skip to content

Location tracking can not be disabled through the DefaultModelXmlFactory #10939

Description

@Giovds

Affected version

4.0.0-rc-4

Bug description

While working on moving the maven-help-plugin to Maven 4 I noticed we no longer use the MavenStaxWriter directly. This is now done through the DefaultModelXmlFactory.

The DefaultModelXmlFactory however does not provide a way to define addLocationInformation on the MavenStaxWriter. The XmlWriterRequest defines a way to set the InputLocationFormatter which is related to the addLocationInformation. The formatter is (currently) only used when locationtracking is requested.

My suggestion would be:

  • Set addLocationInformation to false by default in DefaultModelXmlFactory.
  • If the XmlWriterRequest specifies an InputLocationFormatter, set addLocationInformation to true and apply the formatter.

Activity

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

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