maven-assembly-plugin

How do you create a standalone application with dependencies intact using Maven?

[亡魂溺海] 提交于 2019-11-30 14:58:15
问题 I have a desktop Java application built using Maven 2 (but I could upgrade to Maven 3 if that helps) with a number of open source dependencies. I'm now trying to package it up as a standalone to make it available to end users without them needing to install maven or anything else. I've successfully used maven-assembly-plugin to build a single jar containing all dependencies but this is not really what I want because when using LGPL libraries you are meant to redistribute the libraries you are

maven: multi-module project assembly into single jar

醉酒当歌 提交于 2019-11-30 14:53:57
问题 I have a multi-module project and want to create a single jar containing the classes of all my modules. Inside my parent POM, I declared the following plugin: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <configuration> <descriptorRefs> <descriptorRef>bin</descriptorRef> </descriptorRefs> </configuration> </plugin> However, when running mvn assembly:assembly, only the source from the parent folder (empty) are included. How do I include

Using maven to build multiple resources assemblies that are very similar

好久不见. 提交于 2019-11-30 14:02:14
I'm having a problem with this very redundant maven configuration. The application I'm working on sometimes gets built for environments that need alternate resource bundles. The current way the resources are prepared for deployment is that they are added to a single .zip file. The build master then deploys the zipped resources to the server. For some environments, alternate versions of some of the resources need to be used. The folder structure in the project looks like this: src/main/resources - resource1 - resource2 - resource2 ENV1/ -resource1 (environment-specific) ENV2/ -resource1

I wish to exclude some class files from my jar. I am using maven-assembly-plugin. It still adds the files. I dont get any error

回眸只為那壹抹淺笑 提交于 2019-11-30 13:01:08
I dont get any error with this code. Just that the file that I want to exclude still gets added. I am using the maven plugin for eclipse <plugin> <artifactId>maven-assembly-plugin</artifactId> <executions> <execution> <id>only</id> <phase>package</phase> <goals> <goal>single</goal> </goals> <configuration> <archive> <manifest> <mainClass>com.Main</mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> <excludes> <exclude>**/com/uiservices/controllers/*.* </exclude> </excludes> </configuration> </execution> </executions> <

maven: multi-module project assembly into single jar

◇◆丶佛笑我妖孽 提交于 2019-11-30 12:45:26
I have a multi-module project and want to create a single jar containing the classes of all my modules. Inside my parent POM, I declared the following plugin: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <configuration> <descriptorRefs> <descriptorRef>bin</descriptorRef> </descriptorRefs> </configuration> </plugin> However, when running mvn assembly:assembly, only the source from the parent folder (empty) are included. How do I include the sources from my modules into the archive? I think you are looking for the Maven Shade Plugin: http:/

How to have maven-assembly-plugin respect the exclusions defined in pom.xml?

老子叫甜甜 提交于 2019-11-30 09:05:58
TL;DR When some (specific) transitive dependencies are excluded in the POM file but the assembly descriptor is set to fetch all dependencies , the excluded dependencies will be included in assembly. How can I prevent this? A bit of background Some dependencies may be tricky to handle because their groupIds and artifactIds change at almost each version (in my case, bouncycastle). I am retrieving several versions of bouncycastle (138, 1.38, 1.45 and 1.50). My purpose is to eliminate all versions other than 1.50. To be precise, I have one dependency (let's call it some.perfectly.done:job ) which

Error reading assemblies: No assembly descriptors found

≯℡__Kan透↙ 提交于 2019-11-30 07:55:52
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 though.... My maven-assembly plugin is added like this in my pom.xml file: <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.2.1</version> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> <configuration> <descriptors> <descriptor>src/main/assembly/src.xml</descriptor> </descriptors> <

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

痴心易碎 提交于 2019-11-30 05:57:49
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 solution? Raghuram This example indicates one way to do this: <dependencySets> <dependencySet> .... <excludes> <exclude>commons-lang:commons-lang</exclude> <exclude>log4j:log4j</exclude> </excludes> </dependencySet> .... </dependencySets> Essentially we would use the excludes option available in dependencySet . See also: https://maven.apache.org

Custom maven assembly

心已入冬 提交于 2019-11-30 05:30:13
I'm starting to work with Maven but am not yet successfully thinking in Maven's terms. I have a specific requirement and the docs aren't giving me enough clues, so I could use a bit of help: I'd like to create an assembly that builds a jar-with-dependencies like the "standard" target of this name, but excluding a couple of the resources. I want log4j.properties and a couple of other configuration files to not be in the jar. builds a .ZIP file containing in its root directory the .jar from step 1 as well as the above mentioned config files. I want to fire this assembly up from the command line

How to assemble multimodule maven project into one WAR?

青春壹個敷衍的年華 提交于 2019-11-30 05:13:06
Similar question here . I would like to get ONE resulting WAR to be deployed from 3 different maven modules. The war modules are absolutely non-conflicting : First one that has Java classes and some WEB-INF/artifacts Second one are just API - interfaces - that must be either already present in container or part of the resulting war (that's what I want) Third one with Implementation classes, WEB-INF/artifacts ( spring infrastructure, web.xml, etc) First one depends on interfaces and implementation. Third one depends on the interfaces. I have a total mess in possible options. Do I use Overlays