apache / apache/parquet-java

Source-distribution builds leave `${buildNumber}` unresolved in version metadata

未关闭
#3,682 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
3.1k
派生
1.6k
平均合并
3 天 12 小时
30 天内合并 PR
33

描述

Building Parquet directly from the ASF source distribution cannot obtain the Git revision because the archive contains no `.git` metadata. Maven records a null `buildNumber`, leaving the placeholder unresolved in generated version information.

### Reproduction

Download and extract the source tarball from the [1.18.0 RC1 directory](https://dist.apache.org/repos/dist/dev/parquet/apache-parquet-1.18.0-rc1/), then run:

```bash
./mvnw -f parquet-generator/pom.xml package -DskipTests

tmp_dir=$(mktemp -d)
java -cp parquet-generator/target/parquet-generator-1.18.0.jar \
org.apache.parquet.version.VersionGenerator "$tmp_dir"

grep FULL_VERSION "$tmp_dir/org/apache/parquet/Version.java"
```

Result:

```text
parquet-mr version 1.18.0 (build ${buildNumber})
```

The JAR manifest’s `git-SHA-1` entry is also blank. In contrast, the [staged Maven JARs](https://repository.apache.org/content/repositories/orgapacheparquet-1081/org/apache/parquet/) correctly contain RC1 commit [`5e2ad0969c7f411613671c5ef054d399995de5f9`](https://github.com/apache/parquet-java/commit/5e2ad0969c7f411613671c5ef054d399995de5f9).

This also reproduces with the official [1.17.0 source distribution](https://archive.apache.org/dist/parquet/apache-parquet-1.17.0/), while the published 1.17.0 Maven JARs correctly contain release commit `fac0c746532e133beb928a7f6a7e57b510b477a1`. Therefore, this predates 1.18.0 and is not an RC1 regression.

### Impact

Source-built artifacts have incomplete or misleading provenance:

- `Version.FULL_VERSION` contains the unresolved placeholder.
- Parquet files written by those artifacts may include it in `created_by`.
- The manifest lacks the Git SHA.
- Source-built and staged artifacts report different build identities.

The build should embed the release commit or use an explicit fallback rather than emitting an unresolved Maven expression.

Relevant source: [`parquet-version.properties`](https://github.com/apache/parquet-java/blob/apache-parquet-1.18.0-rc1/parquet-generator/src/main/resources/parquet-version.properties).

贡献指南

这个仓库没有索引到贡献指南

调研方向

从 parquet-generator/src/main/resources/parquet-version.properties 开始,使用提供的 ./mvnw 命令和 VersionGenerator 调用重现该问题。检查生成的 Version.java 和 JAR manifest;当 source-distribution builds 不再输出未解析的 ${buildNumber} 占位符,并包含适当的 build identity 时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
git, java
领域
build-system, release
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
55/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。