smik-jar-tool reads and updates the softwareVersion property in a fixed set
of Spring Boot property files inside a JAR archive.
The workspace contains two crates:
smik-jar-toolprovides the command-line application.smik-jar-libprovides the reusable archive API.
Dependency versions, features, and workspace crate paths are defined once in
the root Cargo.toml under [workspace.dependencies]. Member crates inherit
their dependencies with workspace = true.
The workspace requires Rust with support for the 2024 edition.
cargo build --releaseThe release binary is written to target/release/smik-jar-tool.
Pass a JAR path without a version to display every version found:
cargo run --bin smik-jar-tool -- application.jarPass a version as the second argument to update the JAR in place:
cargo run --bin smik-jar-tool -- application.jar 2.4.0The tool looks below BOOT-INF/classes/ for these files:
application.propertiesapplication-dev.propertiesapplication-int.propertiesapplication-local.propertiesapplication-prod.properties
Missing property files are skipped. During an update, every discovered file is
rewritten with the requested softwareVersion; a missing property is added.
Other archive entries are preserved.
The update command streams the reconstructed JAR into an anonymous file
created by the tempfile crate. Once reconstruction succeeds, it streams that
file through the same owned archive file and truncates the archive to its new
length. The temporary file is removed automatically when dropped. The archive
is not held in an intermediate RAM buffer. Keep a backup when modifying an
artifact that cannot be recreated. Rewriting a signed JAR invalidates
signatures that cover changed content.
Set RUST_LOG to control diagnostics:
RUST_LOG=info cargo run --bin smik-jar-tool -- application.jarRun the workspace checks from the repository root:
cargo +nightly fmt --check
cargo clippy --all-features
cargo test --all-features
cargo build --all-features --releaseSee ARCHITECTURE.md for the internal design and extension
points.
This workspace is licensed under the MIT License.