maven-assembly-plugin

disable the execution: default-jar

放肆的年华 提交于 2019-11-27 09:13:33
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> . (...) 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). Looks like you're

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

梦想的初衷 提交于 2019-11-27 09:12:52
This is my pom file: <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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.sia.g7</groupId> <artifactId>sia</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <name>sia</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.12</version> </dependency> <dependency> <groupId>commons-math</groupId>

Using maven to output the version number to a text file

不羁的心 提交于 2019-11-27 06:40:00
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 updated version.txt based on filtering. Then another one with a single goal actually packages the zip file.

Apache Maven Assembly Plugin not working with OSGi bundles

拥有回忆 提交于 2019-11-27 06:31:24
问题 I have a Maven OSGi multi-module project. The project runs perfectly well when the OSGi picks the module jars from the individual project modules. (view 1.1.B below) . However, using a second approach, bundle.getRegisteredServices() (view 1.1.A below) returns null whenever I try using bundles deposited into a central folder (D:/parent/provider/target/modules) using the maven-assembly-plugin version : 2.6: framework.getBundleContext().installBundle("file:D:/parent/provider/target/modules

Multiple assemblies from one maven project [duplicate]

不羁的心 提交于 2019-11-27 03:43:35
问题 This question already has an answer here : Creating Two Executable Jars Using maven-assembly-plugin (1 answer) Closed 2 years ago . 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: <project> <groupId>net.company.BaseTool</groupId> <artifactId>BaseTool</artifactId> <version>1.1.0-SNAPSHOT</version> <packaging>jar<

maven-assembly-plugin: How to use appendAssemblyId

为君一笑 提交于 2019-11-27 02:40:16
问题 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 functions. No other modules depends on this and its only intended for the user to run it manually in certain situations. Here is the code that I use to configure the maven-assembly-plugin plugin: <plugin> <artifactId> maven-assembly-plugin </artifactId>

Maven assembly : add different version of the same artifact

强颜欢笑 提交于 2019-11-27 01:51:10
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 dependenvcy resolver remove the old version and only the 1.1.0 is packaged in the archive I try to

Creating Two Executable Jars Using maven-assembly-plugin

℡╲_俬逩灬. 提交于 2019-11-27 01:19:57
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 profiles. The relevant section of my POM file looks like this: <profiles> <profile> <id>publisher</id> <build>

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

被刻印的时光 ゝ 提交于 2019-11-26 19:36:09
问题 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 spread over multiple packages. As a result I end up with a lot of functionality, which is not really needed in all the projects. Since this library is also used inside some mobile/PDA projects I need a way to collect just the used classes and generate

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

ⅰ亾dé卋堺 提交于 2019-11-26 18:39:21
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 forum.springsource.org thread (message #7/8) the problem occurs because the files META-INF/spring.handlers and META-INF/spring.schemas that are present in different jars, get overwritten when the maven-assembly-plugin repackages the jars in a single file. Looking at the content of two spring-*.jar files you can see the files sits in the same position