tvelykyy tvelykyy - 2 years ago 205
Groovy Question

Maven zip artifact copy, unzip and rename

I have a maven module which is packaged as a zip with naming using maven-shade-plugin.

Once the artifact has been installed into local maven repo, I need:

  1. Copy zip to configured local folder.

  2. Unzip archive.

  3. Rename unzipped folder from my-artifact-1.0-SNAPSHOT to my-artifact.

This process should be cross-platform working on Windows, Linux, MacOS machines.

I read that it could be accomplished by using:

  1. maven-dependency-plugin plus another plugin

  2. maven-groovy-plugin

What would the best way to implement such a flow? Any examples are very appreciated.

tom tom
Answer Source

No need for antrun in my opinion, the maven-dependency-plugin should do the trick:




Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download