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
38
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,512
  • 1
  • 12
  • 19
37
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…
acorello
  • 4,473
  • 4
  • 31
  • 46
33
votes
1 answer

Maven: Include resources into JAR

I have some terrible beaviour. I have the following Maven configuration:
marc3l
  • 2,525
  • 7
  • 34
  • 62
32
votes
1 answer

Maven best practice for generating multiple jars with different/filtered classes?

I developed a Java utility library (similarly to Apache Commons) that I use in various projects. In addition to fat clients, I also use it for mobile clients (PDA with J9 Foundation profile). In time the library that started as a single project…
user68682
  • 745
  • 2
  • 12
  • 18
32
votes
1 answer

maven assembly include the current project jar in the final zip/tar

I am using maven assembly plugin to generate a .tar file contain several other files, dependent jars. All the files are being copied correctly to the given folders in the config assembly.xml. I would like to include the original project jar too in…
mtk
  • 13,221
  • 16
  • 72
  • 112
31
votes
0 answers

When should scripts be put in /src/main/scripts (maven standard) and when not?

The Maven Standard Directory Layout says that scripts should be placed in src/main/scripts in a maven project. Besides the advantages of "convention over configuration" are there any other advantages of doing it this way? I have a project that…
Steve Cohen
  • 4,679
  • 9
  • 51
  • 89
28
votes
4 answers

Maven Assembly Plugin is not setting the MainClass manifest setting

I have a maven project which generates a jar via the maven assembly plugin I want to run as a console app. However, the MainClass attribute is not being set in MANIFEST.MF. Here is my plugin configuration:
Justin Dearing
  • 14,270
  • 22
  • 88
  • 161
28
votes
2 answers

How to configure maven:assembly root path in the jar

Here is the pom.xml
Dreamer
  • 7,333
  • 24
  • 99
  • 179
25
votes
6 answers

maven-assembly-plugin doesn't add dependencies with system scope

This is my pom file:
Macarse
  • 91,829
  • 44
  • 175
  • 230
25
votes
2 answers

Deploying assembly package with maven-release-plugin

We use Hudson and the maven-release-plugin to do the release builds. Now I have a project which contains an assembly that puts together all needed components and then packages them into a .tar.gz package with the desired directory structure. Now I'm…
25
votes
3 answers

Maven - Include dependent libs in jar without unpacking dependencies?

We're trying to build a client jar that includes unpacked dependent jar's. And the manifest should have class-path entries to the dependent jars. The snippet below works but the jars are unpacked - how can we stop the jars from being unpacked? …
Marcus Leon
  • 55,199
  • 118
  • 297
  • 429
25
votes
3 answers

Manipulate project version property to remove SNAPSHOT?

I've got a project at version 0.0.1-SNAPSHOT, and when we build it via TeamCity, we also get a build.vcs.number property, which is the Subversion revision that triggered the build. In our assemblies, we create a zip file called something like…
RCross
  • 4,919
  • 4
  • 44
  • 42
24
votes
6 answers

How do I suppress maven assembly plugin skipping files that are already added? Or allow overwrite?

For weeks, I've been wrestling with maven, getting it to deploy our project "properly." I'm almost done but I have one stubborn little problem: When I use the maven assembly plugin with the "directory" goal as in mvn assembly:directory I get LOTS of…
gMale
  • 17,147
  • 17
  • 91
  • 116
23
votes
2 answers

Disable the default-jar execution

I am using Maven Assembly plugin to pack a jar file. But when I run mvn package, maven always trigger the [jar:jar {execution: default-jar}] to create a default jar file. So I will have 2 jar files (one created by Assembly plugin and one created by…
David
  • 3,538
  • 9
  • 39
  • 50
21
votes
2 answers

Override maven-assembly-plugin output file name

Is it possible to override the default name of the jar file created running the assembly:single goal? I want to add a jar with dependencies that has a non-standard name. I am using version 2.6 of the plugin.
softweave
  • 1,455
  • 2
  • 16
  • 27
1
2
3
72 73