maven-assembly-plugin

Creating Two Executable Jars Using maven-assembly-plugin

戏子无情 提交于 2019-12-04 05:01:21
问题 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 files to be identical except for the Main-Class attribute in the MANIFEST.MF file. I am using maven-antrun-plugin to create an executable jar and this seemed to be working fine until I tried to create a second jar file by introducing Maven

Maven assembly plugin not applying fileMode on unpacked dependencySet

允我心安 提交于 2019-12-04 03:38:18
问题 I have been banging my head against the wall all afternoon with this one. I need to create a pair of assemblies ( zip and tgz ) and need to set the correct executable permissions for shell scripts included in the archive. It doesn't seem to make any difference what I do, the fileMode settings seem to have no effect. Here is a snippet from my assembly descriptor: <dependencySet> <useProjectArtifact>false</useProjectArtifact> <useStrictFiltering>true</useStrictFiltering> <outputDirectory><

How to exclude some of the folders while creating zip file through maven

我只是一个虾纸丫 提交于 2019-12-04 02:43:41
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembl/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"> <id>bin</id> <baseDirectory>/</baseDirectory> <formats> <format>zip</format> </formats> <fileSets> <fileSet> <directory>src/main</directory> <outputDirectory>/</outputDirectory> <excludes> <exclude>src/main/dml</exclude> </excludes> </fileSet> </fileSets> </assembly> This is my assemble.xml. src/main contains several

Merging META-INF/services files with Maven Assembly plugin

天大地大妈咪最大 提交于 2019-12-04 02:15:49
问题 I am looking for a way to merge META-INF/services files, e.g. META-INF/services/javax.ws.rs.ext.Providers , when building jar-with-dependencies using Maven Assembly plugin. I have found answers showing how to do that using Maven Shade plugin. Unfortunately, we are extensively using Mave Assembly plugin already and it is unclear how we could plug Maven Shade plugin...in. 回答1: It turns out that some versions of Maven Assembly plugin can merge these files: <assembly xmlns="http://maven.apache

Maven, how to copy files?

孤人 提交于 2019-12-04 01:24:47
问题 I want to copy some files (jar, launch scripts, docs) to some directory, like dist/ in project root. I am using maven-assembly-plugin and set <configuration><outputDirectory> in pom.xml. It creates files in dist/ but inside <my_project>-<decsriptor_id>/ subdirectory. Is there any way to output it just in the root of dist/ ? Or is there a plugin in Maven that simply copies files? <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>3.0.0</version> <executions> <execution> <id>maven

Creating a tar.gz archive with Maven

蹲街弑〆低调 提交于 2019-12-04 00:31:32
I have a Maven project, where under src/main directory there is a sub dir called output. this folder needs to be packaged into tar.gz. when using the assembly plugin as follows: From the pom.xml: <build> <finalName>front</finalName> <plugins> <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.2-beta-5</version> <configuration> <descriptors> <descriptor>src/main/assembly/assembly.xml</descriptor> </descriptors> </configuration> </plugin> </plugins> </build> the assembly.xml: <assembly> <id>bundle</id> <formats> <format>tar.gz</format> </formats> <fileSets> <fileSet> <directory

Maven assembly plugin add dependencies

本小妞迷上赌 提交于 2019-12-03 21:56:13
I have a java application and using maven-assembly-plugin I want to add my dependencies to a /lib folder in my release. In a web project its simple because jars are already in the war file. I coudln't figure out to do it in standart java application since all external jars are in my local .m2 repository. I often work with this assembly configuration <assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven

Maven Assembly Plugin - install the created assembly

依然范特西╮ 提交于 2019-12-03 16:53:54
问题 I have a project that simply consists of files. I want to package those files into a zip and store them in a maven repository. I have the assembly plugin configured to build the zip file and that part works just fine, but I cannot seem to figure out how to install the zip file? Also, if I want to use this assembly in another artifact, how would I do that? I am intending on calling dependency:unpack, but I don't have an artifact in the repository to unpack. How can I get a zip file to be in my

Use Maven assembly plugin to set Linux file permissions even when run on other platforms?

余生长醉 提交于 2019-12-03 16:23:29
问题 Similar question: Can Ant's tar task set a Linux file permission even when the task is used on other platforms? If I use Maven 2 assembly plugin with the 'project' descriptor, is there a way to set shell script permissions to executable for example for included build.sh script files? Example: <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.2</version> <configuration> <descriptorRefs> <descriptorRef>project</descriptorRef> </descriptorRefs> </configuration> </plugin> This

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

旧街凉风 提交于 2019-12-03 15:06:35
问题 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 console output like the following: [INFO] tomcat/conf already added, skipping [INFO] tomcat/conf/Catalina already added, skipping [INFO] tomcat/conf/Catalina/localhost already added, skipping [INFO] tomcat/webapps already added, skipping I've