Skip to content

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

Closed
commi wants to merge 1 commit into
upstream-develfrom
fix-zipball-name
Closed

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

Conversation

@commi

@commi commi commented Aug 21, 2026

Copy link
Copy Markdown
Owner

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.

@commi
commi force-pushed the fix-zipball-name branch 3 times, most recently from 220f081 to b6610df Compare August 21, 2026 13:01
- 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>
@commi
commi force-pushed the fix-zipball-name branch from b6610df to 57c27b9 Compare August 21, 2026 13:05
@commi

commi commented Aug 21, 2026

Copy link
Copy Markdown
Owner Author

Superseded by javapackager#489.

@commi commi closed this Aug 21, 2026
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