maven-assembly-plugin

Apache Maven Assembly Plugin not working with OSGi bundles

試著忘記壹切 提交于 2019-11-28 11:48:59
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/OSGiDmHelloWorldProvider-1.0.jar"); framework.getBundleContext().installBundle("file:D:/parent/provider

Multiple assemblies from one maven project [duplicate]

試著忘記壹切 提交于 2019-11-28 10:41:02
This question already has an answer here: Creating Two Executable Jars Using maven-assembly-plugin 1 answer 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</packaging> <name>BaseTool</name> <build> <plugins> <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <archive

How to create zip target instead of jar in maven?

不想你离开。 提交于 2019-11-28 04:28:55
问题 Can someone please help me in creating a zip target instead of jar in maven. I tried several ways but couldn't progress. Given descriptor file in the assembly path is as follows: <assembly> <formats> <format>zip</format> </formats> <fileSets> <fileSet> <directory>src/main</directory> </fileSet> </fileSets> </assembly> The assembly plugin section in my pom file is as follows: <build> <plugins> <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <descriptors> <descriptor>src

remove jar created by default in maven

孤街醉人 提交于 2019-11-28 03:38:06
问题 I am using maven assembly plugin. in my pom.xml, pakaging type: jar and i dont use maven jar plugin. Whenever i run mvn clean package, it create 2 jar files: one is from maven assembly, another one is created by default (due to packaging type =jar). I want to keep only the jar file created by assembly plugin only. How to do that? 回答1: You may have your reasons but I doubt that it is a good solution to skip the default jar being built and deployed. Anyhow here is how you can disable the

How to include external jars in maven jar build process?

时光毁灭记忆、已成空白 提交于 2019-11-28 02:32:35
问题 I want to build a .jar file with dependencies in maven. Unfortunately I have to include some external .jars in my buildpath. When I now try to build this project with maven package I will get an error that those external .jars are not found. How to adapt my pom file to add those jars? current: <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <groupId>org

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

为君一笑 提交于 2019-11-27 18:45:21
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 the actual specialized jars. Currently in the projects that are using this library, I have Ant jar

Merge properties files with Maven assembly

寵の児 提交于 2019-11-27 16:16:43
问题 I have a problem with maven assembly plugin. I have a maven project which use several jars. Each jar contains configuration files. With another project, I use maven assembly plugin to assemble all configurations in unique jar. All work fine but unfortunately, two files are the same name and the second overwrites the first. I don't achieve to tell maven to merge the two files instead of overwrite. Someone knows how to do that ? Thanks. 回答1: It is not exactly what you are looking for, but I

Exception starting Spring application from Java

余生长醉 提交于 2019-11-27 13:17:08
I am able to compile and start my Spring project using Maven: mvn -e clean compile exec:java -Dexec.mainClass=de.fraunhofer.fkie.tet.vmware.manager.Test However, when I assemble all jars in a single file using the maven-assembly-plugin (including applicationContext.xml ), I always get an Exception during the java execution: java -cp target/test-jar-with-dependencies.jar:. de.fraunhofer.fkie.tet.vmware.manager.Test INFO: Loading XML bean definitions from class path resource [applicationContext.xml] Sep 6, 2010 10:37:21 AM org.springframework.util.xml.SimpleSaxErrorHandler warning WARNING:

Maven best practice for generating artifacts for multiple environments [prod, test, dev] with CI/Hudson support?

喜欢而已 提交于 2019-11-27 13:00:23
问题 I have a project that need to be deployed into multiple environments ( prod, test, dev ). The main differences mainly consist in configuration properties/files. My idea was to use profiles and overlays to copy/configure the specialized output. But I'm stuck into if I have to generate multiple artifacts with specialized classifiers (ex: "my-app-1.0-prod.zip/jar", "my-app-1.0-dev.zip/jar") or should I create multiple projects, one project for every environment ?! Should I use maven-assembly

Create multiple runnable Jars (with dependencies included) from a single Maven project [duplicate]

北城余情 提交于 2019-11-27 12:22:49
This question already has an answer here: Creating Two Executable Jars Using maven-assembly-plugin 1 answer I have a single maven project that has multiple main classes. I want to generate runnable Jars (that include all dependencies) out of these project. I currently have the following build configuration (using maven.assembly): <build> <plugins> <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <archive> <manifest> <mainClass>classpath.to.my.mainClass</mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> <