user6253673
user6253673

Reputation: 27

Maven Deploy as tar.gz

I currently have a jar generated through lein/clojure and a separate shell script. I'd like to use maven to deploy these two as a tarball to a remote repository. Is there any way I can just compress and deploy these two files as tar.gz? I've tried changing the -Dpackaging=tar.gz option. Ideally, since I'm deploying artifacts not generated by Maven, I wouldn't have to use a Maven assembly too.

Upvotes: 1

Views: 1902

Answers (1)

Mickael
Mickael

Reputation: 4558

From official Maven documentation :

Cookbook: How To Generate Assembly?

Summary

This recipe describes how to generate assembly like zip, tar.gz or tar.bz2.

Sample Generated Output

attach-source-javadoc
|-- pom.xml
|-- src\
`-- target
    `-- apache-maven-cookbook-1.0-SNAPSHOT-bin
    `-- apache-maven-cookbook-1.0-SNAPSHOT-bin.tar.bz2
    `-- apache-maven-cookbook-1.0-SNAPSHOT-bin.tar.gz
    `-- apache-maven-cookbook-1.0-SNAPSHOT-bin.zip

Recipe

Configuring Assembly Descriptor

To generate an assembly, we need to configure an assembly descriptor called bin.xml in the src/assembly directory. Firstly, we specify the wanted formats, i.e.

<formats>
  <format>tar.gz</format>
  <format>tar.bz2</format>
  <format>zip</format>
</formats>

Upvotes: 1

Related Questions