views:

94

answers:

1

I've got a Maven2 project, where I use assembly plugin. Everything would be just fine if created assembly file name wouldn't ended with format extension (ex. ".zip"). I specified in plugin configuration a fileName parameter and setted appendAssemblyId to false. I have already spent few hours on that problem... Any idea?

A: 

My answer is a bit of a non-answer - don't remove the format extension. If you are using a specific <format> in your assembly descriptor to produce an artifact (zip, tar.gz, etc.) there is exists no good reason to remove the extension from the file. If I'm a user of your software and download this binary, I don't want to have to guess as to what the packaging type is, I should be able to tell just by looking at the filename.

FWIW, setting appendAssemblyId to false means that the <id> of your assembly descriptor will not be included in your file name.

Now, if you really are dead set on making this a pain for you and everyone else, what you probably want to do (as with most nonsensical things people want to make maven do) is to either use the antrun plugin to rename the generated file during your maven invocation, or just simply run a shell script to rename it after your maven process has finished.

whaley
Well... I need to remove ".zip" from a file because I'm developing a plugin to some software, and it needs a plugin with specific extension. This plugin is basically a ZIP archive with appropriate structure.
Ajan
I really need to invoke mvn assembly:assembly separately because I don't want to build assembly during every compile process. I was trying to use Exec Plugin, but Assembly plugin creates it's own building process with only package phase and if I was trying to bind renaming command with package phase then whole build process was failing everytime because reanming was executed before creating assembly
Ajan