Skip to content

Conversation

@snazy
Copy link
Member

@snazy snazy commented Nov 24, 2025

It turned out in practice, that there's no guarantee that the <parent> element in pom.xml files always appear at the same place.

This change ensures that the <parent> elements always appears at a deterministic location at the top of pom.xml files.

It turned out in practice, that there's no guarantee that the `<parent>` element in `pom.xml` files always appear at the same place.

This change ensures that the `<parent>` elements always appears at a deterministic location at the top of `pom.xml` files.
@snazy
Copy link
Member Author

snazy commented Nov 24, 2025

For posterity a pom.xml from 1.3.0-incubating-rc0's staging. Notice the XML elements at the end.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <!-- This module was also published with a richer model, Gradle metadata,  -->
  <!-- which should be used instead. Do not delete the following line which  -->
  <!-- is to indicate to Gradle or any Gradle module metadata file consumer  -->
  <!-- that they should prefer consuming it instead. -->
  <!-- do_not_remove: published-with-gradle-metadata -->
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.apache.polaris</groupId>
  <artifactId>polaris-persistence-nosql-benchmark</artifactId>
  <version>1.3.0-incubating</version>
  <packaging>pom</packaging>
  <licenses>
    <license>
      <name>Apache-2.0</name>
    </license>
  </licenses>
  <parent>
    <groupId>org.apache.polaris</groupId>
    <artifactId>polaris</artifactId>
    <version>1.3.0-incubating</version>
  </parent>
  <dependencies/>
</project>

And locally built:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <!-- This module was also published with a richer model, Gradle metadata,  -->
  <!-- which should be used instead. Do not delete the following line which  -->
  <!-- is to indicate to Gradle or any Gradle module metadata file consumer  -->
  <!-- that they should prefer consuming it instead. -->
  <!-- do_not_remove: published-with-gradle-metadata -->
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.apache.polaris</groupId>
  <artifactId>polaris-persistence-nosql-benchmark</artifactId>
  <version>1.3.0-incubating</version>
  <packaging>pom</packaging>
  <licenses>
    <license>
      <name>Apache-2.0</name>
    </license>
  </licenses>
  <dependencies/>
  <parent>
    <groupId>org.apache.polaris</groupId>
    <artifactId>polaris</artifactId>
    <version>1.3.0-incubating</version>
  </parent>
</project>

val parentNode = projectNode.appendNode("parent")
// Guarantee that the <parent> element is at a deterministic location.
// This is important for reproducible builds!
projectNode.remove(parentNode)
Copy link
Contributor

Choose a reason for hiding this comment

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

why append on line 61 and immediately remove here?

@github-project-automation github-project-automation bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Nov 24, 2025
@snazy snazy merged commit b41b2bb into apache:main Nov 24, 2025
15 checks passed
@snazy snazy deleted the pom-always-reproducible branch November 24, 2025 15:59
@github-project-automation github-project-automation bot moved this from Ready to merge to Done in Basic Kanban Board Nov 24, 2025
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