Questions tagged [maven-assembly-plugin]

The Assembly Plugin for Maven is primarily intended to allow users to aggregate the project output along with its dependencies, modules, site documentation, and other files into a single distributable archive.

The maven-assembly-plugin supports creating of different kind of archives like zip, tar, tar.gz etc. using the assembly:single goal. One can include not only project resources, but also dependencies and arbitrary content, making this a very versatile plugin.

More information on the Maven Assembly Plugin can be found at its home page.

1088 questions
161
votes
6 answers

Is it possible to rename a maven jar-with-dependencies?

I'm currently using the jar-with-dependencies assembly to create such a jar. However, the name of my jar is a bit long. Since this jar is being used by RPG programs on an AS400, I'd like to shorten it to make life a bit easier for those…
Mike Cornell
  • 5,909
  • 4
  • 29
  • 38
154
votes
7 answers

Building a fat jar using maven

I have a code base which I want to distribute as jar. It also have dependency on external jars, which I want to bundle in the final jar. I heard that this can be done using maven-assembly-plug-in, but I don't understand how. Could someone point me…
bianca
  • 7,004
  • 12
  • 43
  • 58
75
votes
14 answers

Using maven to output the version number to a text file

I want to generate a zip file that will update an application with maven. The zip will be hosted on a server and I am using the assembly plugin to generate the zip. However I would like maven to automatically generate a text file that stores the…
sanz
  • 1,232
  • 1
  • 9
  • 17
72
votes
7 answers

Maven 2 assembly with dependencies: jar under scope "system" not included

I am using maven-assembly plugin to create a jar of my application, including its dependencies as follows: macosx tar.gz dir
YuppieNetworking
  • 8,672
  • 7
  • 44
  • 65
59
votes
4 answers

Changing the order of maven plugins execution

I am new to maven, I would like to change the order of the maven plugins execution. In my pom.xml, I have maven-assembly-plugin and maven-ant-plugin. maven-assembly-plugin for creating a zip file. maven-ant-plugin for copying the zip file from…
user1062115
  • 591
  • 1
  • 4
  • 4
53
votes
3 answers

Maven assembly plugin warning "The assembly descriptor contains a filesystem-root relative reference"

Starting from some assembly plugin version maven builds issue the following warning: [WARNING] The assembly descriptor contains a filesystem-root relative reference,which is not cross platform compatible / Is there any recommended ready-to-use…
Roman Nikitchenko
  • 12,800
  • 7
  • 74
  • 110
52
votes
3 answers

Maven - Depend on assembled zip

I'm trying to have a Project B pull down (and unpack) a ZIP built by Project A and deployed to a remote repository. The ZIP is created and attached using the maven-assembly-plugin, with packaging type…
46
votes
3 answers

Maven: Packaging dependencies alongside project JAR?

I'd like Maven to package a project alongside its run-time dependencies. I expect it to create a JAR file with the following manifest: ..... Main-Class : com.acme.MainClass Class-Path : lib/dependency1.jar lib/dependency2.jar ..... and create the…
Gili
  • 86,244
  • 97
  • 390
  • 689
44
votes
4 answers

Create multiple runnable Jars (with dependencies included) from a single Maven project

I have a single maven project that has multiple main classes. I want to generate runnable Jars (that include all dependencies) out of these project. I currently have the following build configuration (using maven.assembly):
Martin Thurau
  • 7,564
  • 7
  • 43
  • 80
42
votes
2 answers

maven-assembly-plugin: How to use appendAssemblyId

I have a multi-module Maven project and in one module I want to create two artifacts during the build: The main artifact which is a jar library that some of the other modules will depend on. An executable jar file that executes some helper…
lanoxx
  • 12,249
  • 13
  • 87
  • 142
41
votes
4 answers

How to exclude dependencies from maven assembly plugin : jar-with-dependencies?

Maven's assembly plugin enables the creation of a big jar including all dependencies with descriptorRef jar-with-dependencies. How can one exclude some of these dependencies? It seems like it does not have such a configuration? Is there another…
Jérôme Verstrynge
  • 57,710
  • 92
  • 283
  • 453
41
votes
3 answers

Error reading assemblies: No assembly descriptors found

I get Error reading assemblies: No assembly descriptors found when building my project. I'm trying to set permissions for my .sh files and exclude a nasty .jar file that makes my application crash...I don't think the problem is about that…
Luli
  • 661
  • 1
  • 6
  • 10
41
votes
2 answers

ERROR OS=Windows and the assembly descriptor contains a *nix-specific root-relative-reference (starting with slash) /

I use maven-assembly-plugin v2.5.3 and get the following error [INFO] Reading assembly descriptor: src/main/assembly/distributive.zip.xml [ERROR] OS=Windows and the assembly descriptor contains a *nix-specific root-relative-reference (starting with…
naXa stands with Ukraine
  • 35,493
  • 19
  • 190
  • 259
40
votes
2 answers

Creating Two Executable Jars Using maven-assembly-plugin

I have a Maven project and I want to create two executable jar files from it. One will be used interactively by users and a second will be run as a scheduled job that reads the log files produced by the former. In the end, I would expect the two jar…
McGlone
  • 3,434
  • 5
  • 26
  • 31
38
votes
3 answers

How do I include an empty directory in a maven assembly?

In what must be a common occurence, I need to include an empty directory in an assembly. In my case it is logs/. I've tried different variations in the assembly descriptor like: ${basedir}/target
Dave Stenglein
  • 1,420
  • 1
  • 12
  • 14
1
2 3
72 73