Skip to content

Maven publication: Produce correct <scm><tag> in pom.xml #1330

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 1 commit into from
Apr 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion build-logic/src/main/kotlin/publishing/configurePom.kt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ internal fun configurePom(project: Project, mavenPublication: MavenPublication,
connection.set("scm:git:$codeRepo")
developerConnection.set("scm:git:$codeRepo")
url.set("$codeRepo/tree/main")
tag.set("main")
val version = project.version.toString()
if (!version.endsWith("-SNAPSHOT")) {
tag.set("apache-polaris-$version")
Copy link
Contributor

Choose a reason for hiding this comment

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

Q: Does it work automatically when we retag with the same version(e.g., 1.1.0)? Or we need to remove the tag first, and run the command mvn release:prepare to retag it?

Retag could be useful when we have multiple release candidates.

Copy link
Member Author

Choose a reason for hiding this comment

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

@flyrain this has nothing to do with Git. It's the project version of the build.
Changing an existing Git release tag is really bad practice.
BTW: we use Gradle, not Maven.

Copy link
Contributor

@dimas-b dimas-b Apr 8, 2025

Choose a reason for hiding this comment

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

I guess this is more of a release process question: For RCs are we going to publish each RC to Maven, or just the final release? If the former case, I suppose tags should be something like apache-polaris-0.10.0-rc1, etc. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the RCs are not published to maven repository. Taking this as an example, https://mvnrepository.com/artifact/org.apache.iceberg/iceberg-core, we can only see the formal ones, like 1.8.0, 1.8.1.

@flyrain this has nothing to do with Git. It's the project version of the build.

@snazy I'm confused by this statement, what do you mean by "nothing related to git"? What does it tag in that case?

Copy link
Member

Choose a reason for hiding this comment

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

It's about Maven staging and content of the pom.

All releases (RC) are published to Maven staging repository, and if the RC pass the staging repo is promoted to Maven Central. If the RC doesn't pass, them the staging repository is deleted.
That's why it looks only the "final" release are on Maven Central, but actually all RCs went to Maven Staging.

The process is:

  • you stage a release on repository.apache.org as a staging repository
  • if release fails, staging repository is dropped
  • if release pass, staging repository is promoted to Maven Central.

Copy link
Contributor

Choose a reason for hiding this comment

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

but promoting to Maven Central does not change POM files, right? So POM should contain the "final" tag even while the release is in progress, it seems 🤔

Copy link
Member

Choose a reason for hiding this comment

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

That's correct: the RC should contain the "final" tag (and the branch the next SNAPSHOT).

}
}
issueManagement { url.set(projectPeople.bugDatabase) }

Expand Down