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.

1048 questions
146
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,721
  • 4
  • 27
  • 38
132
votes
6 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
  • 6,366
  • 12
  • 39
  • 55
63
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,113
  • 6
  • 40
  • 62
58
votes
12 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,062
  • 1
  • 8
  • 17
49
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
  • 11,946
  • 7
  • 65
  • 101
47
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
  • 76,473
  • 85
  • 341
  • 624
38
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
  • 621
  • 1
  • 5
  • 10
36
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,400
  • 1
  • 11
  • 14
36
votes
2 answers

Idea to avoid that spring.handlers/spring.schemas get overwritten when merging multiple spring dependencies in a single jar

I got the error Unable to locate NamespaceHandler when using context:annotation-config running (java -jar) a jar assembled by the maven-assembly-plugin and containing my project and all its dependencies. As other people correctly spotted on the…
protoboolean
  • 3,935
  • 4
  • 27
  • 45
35
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,312
  • 7
  • 39
  • 76
35
votes
3 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
  • 51,859
  • 84
  • 263
  • 429
34
votes
1 answer

Multiple assemblies from one maven project

we have different java source code "projects". 3 projects are completly identical(fatclient, same dependencies etc.) - there is only another main class that have to be invoked. Today we have one base-project with a main class:
Mirko
  • 1,386
  • 1
  • 11
  • 19
33
votes
1 answer

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
  • 9,908
  • 7
  • 67
  • 113
32
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
  • 26,677
  • 15
  • 154
  • 213
1
2 3
69 70