maven-assembly-plugin

Exception starting Spring application from Java

烂漫一生 提交于 2019-11-26 18:16:13
问题 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

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

亡梦爱人 提交于 2019-11-26 15:59:10
问题 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> <

Maven - Depend on assembled zip

孤街醉人 提交于 2019-11-26 10:43:17
问题 I\'m trying to have a Project B pull down (and unpack) a ZIP built by Project A and deployed to a remote repository. The ZIP is created and attached using the maven-assembly-plugin , with packaging type pom : <artifactId>project-a</artifactId> <name>ZIP</name> <description>Used by Project B</description> <packaging>pom</packaging> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <executions> <execution> <id>distribution-package</id>

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

只愿长相守 提交于 2019-11-26 06:29:39
问题 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

Maven 2 assembly with dependencies: jar under scope “system” not included

随声附和 提交于 2019-11-26 03:38:27
I am using maven-assembly plugin to create a jar of my application, including its dependencies as follows: <assembly> <id>macosx</id> <formats> <format>tar.gz</format> <format>dir</format> </formats> <dependencySets> <dependencySet> <includes> <include>*:jar</include> </includes> <outputDirectory>lib</outputDirectory> </dependencySet> </dependencySets> </assembly> (I omitted some other stuff that is not related to the question) So far this has worked fine because it creates a lib directory with all dependencies. However, I recently added a new dependency whose scope is system , and it does not

Maven 2 assembly with dependencies: jar under scope “system” not included

笑着哭i 提交于 2019-11-26 01:14:16
问题 I am using maven-assembly plugin to create a jar of my application, including its dependencies as follows: <assembly> <id>macosx</id> <formats> <format>tar.gz</format> <format>dir</format> </formats> <dependencySets> <dependencySet> <includes> <include>*:jar</include> </includes> <outputDirectory>lib</outputDirectory> </dependencySet> </dependencySets> </assembly> (I omitted some other stuff that is not related to the question) So far this has worked fine because it creates a lib directory

Building a fat jar using maven

给你一囗甜甜゛ 提交于 2019-11-25 22:26:17
问题 I have a code base which I want to distribute as jar. It also have dependency on external jars, which I want to bundle in the final jar. I heard that this can be done using maven-assembly-plug-in , but I don\'t understand how. Could someone point me to some examples. Right now, I\'m using fat jar to bundle the final jar. I want to achieve the same thing using maven. 回答1: Note: If you are a spring-boot application, read the end of answer Add following plugin to your pom.xml The latest version