maven-assembly-plugin

Maven: Include resources into JAR

霸气de小男生 提交于 2019-12-17 22:49:36
问题 I have some terrible beaviour. I have the following Maven configuration: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <artifactId>Test2Certificate</artifactId> <version>0.1.0-SNAPSHOT</version> <packaging>jar</packaging> <parent> <groupId>com.test</groupId> <artifactId>build</artifactId> <version>1.0

Maven: Packaging dependencies alongside project JAR?

自古美人都是妖i 提交于 2019-12-17 21:53:02
问题 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 following directory structure: target |-- .... |-- my-project.jar |-- lib |-- dependency1.jar |-- dependency2.jar Meaning, I want the main JAR to exclude any dependencies and I want all transitive dependencies to get copied into a "lib" sub-directory

disable the execution: default-jar

非 Y 不嫁゛ 提交于 2019-12-17 09:50:58
问题 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 maven jar which i dont want to be created). How can i turn off the execution: default-jar. in my pom.xml, i am using : <packaging>jar</packaging> . i dont want to change it to <packaging>pom</packaging> . 回答1: (...) So i will have 2 jar files (one

Using maven to output the version number to a text file

[亡魂溺海] 提交于 2019-12-17 08:29:19
问题 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 current version number outside the zip. How is this possible? EDIT: I successfully did it using the maven Assembly Plugin and two descriptors to create two custom assemblies. One has a directory-single goal and it just creates a folder with the

Maven assembly : add different version of the same artifact

本秂侑毒 提交于 2019-12-17 06:46:54
问题 I create my application archive with the maven assembly plugin. All the dependency present in my pom are included without any problem. Now I need to include two or more version of the same artifact. If in my pom I put <dependencies> [...] <dependency> <groupId>db.test</groupId> <artifactId>my-model</artifactId> <version>1.0.3</version> </dependency> <dependency> <groupId>db.test</groupId> <artifactId>my-model</artifactId> <version>1.1.0</version> </dependency> </dependencies> Of source the

How do I set directory permissions in maven output?

若如初见. 提交于 2019-12-14 03:43:05
问题 I am using the maven-assembly-plugin to package my build. I am able to perform some copying of file sets and modify file permissions fine, but I am unable to modify directory permissions. From the documentation, I am trying to use on the directories I care about. However, regardless of what permissions I specify, directories are ALWAYS created based off of the current umask (0022). Does anyone know of a clean way to modify directory permissions in this way during a Maven build. The only thing

maven assembly plugin do not set file attributes

ぐ巨炮叔叔 提交于 2019-12-14 02:23:12
问题 I know this is a duplicate of Maven assembly plugin not applying fileMode on unpacked dependencySet but it's still unanswered. My assembly is <assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"> <id>distribution</id> <formats> <format>tar.gz</format> </formats>

Maven Plugin Execution Order and excluding js files

女生的网名这么多〃 提交于 2019-12-13 20:48:45
问题 I have developed the pom.xml to first combine all the js files in the project and then compress the JS file. These 2 steps are two plugin and are in compile phase. But some how few times puglin execution order is reversed and build fails. In case some one has seen this issue please redirect me to solution. Secondly, I don't to include the JS in .war which are combined and compressed. 回答1: To strictly answer the first part of the question, plugins bound to the same phase are supposed to be

Maven war plugin not able to exclude libs in exploded war format

a 夏天 提交于 2019-12-13 14:27:01
问题 I am using maven war plugin to exclude some common jar and put them in the classpath. I am able to generate war file properly which excludes specified libs and add them in the classpath but exploded war directory still contains excluded libararies. How can I generate exploded war file which use configuration of maven war plugin. <project> <modelVersion>4.0.0</modelVersion> <groupId>com.ekaplus.ctrm.mdm</groupId> <artifactId>core-presentation</artifactId> <version>1.0</version> <packaging>war<

How can we zip two separate directories in seperate zip files, using assembly plugin?

烂漫一生 提交于 2019-12-13 07:23:28
问题 I have tried below with same assembly descriptor with two executions in pom.xml . The problem is both zip files are mixing since they are calling one after other the same file. Is there any way we can achieve this without going for two different assembly descriptor files? 回答1: If you're trying to create two different zip files from two different directories, you'll need two different assembly descriptors. Each descriptor describes which files go into the end result. 来源: https://stackoverflow