Skip to content

RATIS-1322. Cannot build from source without repo#429

Merged
runzhiwang merged 3 commits intoapache:masterfrom
adoroszlai:RATIS-1322
Feb 25, 2021
Merged

RATIS-1322. Cannot build from source without repo#429
runzhiwang merged 3 commits intoapache:masterfrom
adoroszlai:RATIS-1322

Conversation

@adoroszlai
Copy link
Contributor

What changes were proposed in this pull request?

Fix the build error that occurs if Ratis directory is not a git repo (which would happen when building from release source artifact):

[INFO] Apache Ratis ....................................... FAILURE [  0.819 s]
...
[ERROR] Failed to execute goal org.codehaus.mojo:buildnumber-maven-plugin:1.4:create-metadata (default) on project ratis: Execution default of goal org.codehaus.mojo:buildnumber-maven-plugin:1.4:create-metadata failed.: NullPointerException -> [Help 1]

revision in ratis-version.properties is set to Unknown in this case. This matches Ozone's properties for the same situation.

https://issues.apache.org/jira/browse/RATIS-1322

How was this patch tested?

$ mvn -DskipTests clean verify; cat target/classes/ratis-version.properties
...
version=1.1.0-SNAPSHOT
revision=1ce8621b295678c780ad7adaf5621d8114fdefc3
name=Apache Ratis
timestamp=1614187092964

$ rm -fr .git
$ mvn -DskipTests clean verify; cat target/classes/ratis-version.properties
...
version=1.1.0-SNAPSHOT
revision=Unknown
name=Apache Ratis
timestamp=1614187444515

@runzhiwang runzhiwang merged commit b541848 into apache:master Feb 25, 2021
@adoroszlai adoroszlai deleted the RATIS-1322 branch February 25, 2021 04:12
symious pushed a commit to symious/ratis that referenced this pull request Feb 20, 2024
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.

2 participants