Skip to content

Fix zipball/tarball name ignoring the name and version properties - #489

Open
commi wants to merge 1 commit into
javapackager:develfrom
commi:fix-zipball-name
Open

Fix zipball/tarball name ignoring the name and version properties#489
commi wants to merge 1 commit into
javapackager:develfrom
commi:fix-zipball-name

Conversation

@commi

@commi commi commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Since c8f54bf the maven zip/tar name comes from build.finalName instead of the packager's name and version.

So name has no effect on the archive name. With two package executions in one build, both write the same file. On Linux the second one overwrites the first. On Windows the rename fails and the archive keeps the name ${build.finalName}.zip:

before:  my-app-1.0.0-windows.zip   (first execution)
         my-app-1.0.0.zip           (second execution, contains my-tool)

after:   my-app-1.0.0-windows.zip
         my-tool-1.0.0-windows.zip

The README documents ${name}-${version}-${platform}.zip, and the gradle plugin still creates that name. This PR updates the maven plugin so it behaves the same way.

The rename is still there, so the read-only finalName warning from c8f54bf does not come back. It now replaces an existing file, because File.renameTo does not do that on Windows. Otherwise a rebuild without clean keeps the old archive.

zipballName and tarballName still work as before. For projects where name is not the artifactId, the default file name changes.

- problem: two package executions in one build write the same zip/tar
  file, and the name property has no effect on the archive name
- cause: since c8f54bf the maven zip/tar name comes from
  build.finalName instead of the packager's name and version
- solution: use name and version again, like the README documents and
  like the gradle plugin does

The rename is still there, so the read-only finalName warning from
c8f54bf does not come back. It now replaces an existing file, because
File.renameTo does not do that on Windows.

Signed-off-by: Till Seifert <me@till.seifert.name>
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.

1 participant