-
Notifications
You must be signed in to change notification settings - Fork 332
Make pom.xml always reproducible #3145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Member
Author
|
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> |
13 tasks
dimas-b
reviewed
Nov 24, 2025
| val parentNode = projectNode.appendNode("parent") | ||
| // Guarantee that the <parent> element is at a deterministic location. | ||
| // This is important for reproducible builds! | ||
| projectNode.remove(parentNode) |
Contributor
There was a problem hiding this comment.
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?
dimas-b
approved these changes
Nov 24, 2025
pingtimeout
approved these changes
Nov 24, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It turned out in practice, that there's no guarantee that the
<parent>element inpom.xmlfiles always appear at the same place.This change ensures that the
<parent>elements always appears at a deterministic location at the top ofpom.xmlfiles.