maven-shade-plugin

What is `dependency-reduced-pom.xml` file which created when calling maven package command?

孤人 提交于 2019-11-29 15:27:21
I'm following maven tutorial from springsource here , and after 1) adding joda-time dependency , and 2) calling mvn package commmand, we get the below file dependency-reduced-pom.xml . My question is, what is the purpose of creating this file besides pom.xml file? Iker Aguayo If you set to true the flag createDependencyReducedPom (by default is true), the dependencies that have been included into the uber JAR will be removed from the <dependencies> section of the generated POM. The reduced POM will be named dependency-reduced-pom.xml and is stored into the same directory as the shaded artifact

Spring 3 NamespaceHandler issues with Maven Shade plugin

南楼画角 提交于 2019-11-29 13:35:17
Spring 3.1.1.RELEASE with Apache Maven 3.0.3 and Maven Shade plugin 1.6. Using the mvn shade plugin to package the artifact in an uber-jar, including its dependencies: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>1.6</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <mainClass>com.MyApplication</mainClass> </transformer> </transformers> </configuration> <

Apache spark Hive, executable JAR with maven shade

心已入冬 提交于 2019-11-29 10:38:20
I'm building apache-spark application with Apache Spark Hive. So far everything was ok - I've been running tests and whole application in Intellij IDEA and all tests together using maven. Now I want to run whole application from bash and let it run with local single-node cluster. I'm using maven-shade-plugin to build single executable JAR. Application crashes when it tries to create new HiveContext out of SparkContext. Thrown exception tells me that hive can't create metastore because there is some problem with datanucleus and its plugin system. I tried to follow several questions how to run

Maven构建可执行jar包--maven-shade-plugin

江枫思渺然 提交于 2019-11-29 09:30:21
###1、将工程打成jar包(不是可执行的jar包) 普通的maven java工程可以通过pom文件的配置将工程打成jar包,但是该jar包无法执行(通过java -jar xxx.jar此方式),因为jar包下的MANIFEST.MF文件中没有MainClass信息。 ###2、将工程打成可执行的jar包 这里使用maven-shade-plugin插件来打包,关于maven-shade-plugin和maven-assembly-plugin的差别,在这不多做说明,有兴趣的可以参考一下链接。 http://chenzhou123520.iteye.com/blog/1706242 http://blog.csdn.net/defonds/article/details/43233131 最后直接放上maven-shade-plugin插件的配置: <build> <finalName>mqConsumer</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>2.4.3</version> <executions> <execution> <phase>package<

How can I exclude *.DSA and *.SF files from shaded jar?

江枫思渺然 提交于 2019-11-29 03:53:31
I have a section in pom.xml <filters> <filter> <artifact>*:*</artifact> <excludes> <exclude>META-INF/*.SF</exclude> <exclude>META-INF/*.DSA</exclude> </excludes> </filter> </filters> I want to exclude *.SF and *.DSA files from final jar. But I get the following message: [INFO] No artifact matching filter *:* and files are not excluded. Does anyone know how to overcome it? I had the same problem. It was fixed by making my artifact selector more specific, e.g. <artifact>bouncycastle:*</artifact> The entire block looks like this: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId

Using Maven shade plugin in a multi module project - NullPointerException

只谈情不闲聊 提交于 2019-11-29 01:50:13
I have a scenario where-in I need to create an uber jar of a multi module maven project including all modules and their dependencies. I tried using maven shade plugin. but it seems to work only when I use it at the module level. If I add the plugin entry in parent pom then the build breaks (it tries to shade the parent pom) [INFO] Replacing original artifact with shaded artifact. [INFO] Replacing null with C:\Projects\foo.bar\target\foobar-0.0.1-SNAPSHOT-shaded.pom [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] -----------------------

Run *.exe file from inside JAR

僤鯓⒐⒋嵵緔 提交于 2019-11-28 12:58:08
I have a huge JAR file, which I created with Maven Shade plugin. I run this with java -jar foo.jar , and my UI opens. Now I want to execute *.exe file, which is also in that JAR file, how can I do this? I tried putting the exe to my classpath and run it from there, but after trying I found out that classpath is actually the location, where my JAR is. Any suggestions? Found this thing here, but is this really the best solution? Seems like alot of work, I think I have different case here, because I can define the location of exe myself and the JAR is created by me. run exe which is packaged

What is `dependency-reduced-pom.xml` file which created when calling maven package command?

一个人想着一个人 提交于 2019-11-28 08:52:30
问题 I'm following maven tutorial from springsource here, and after 1) adding joda-time dependency , and 2) calling mvn package commmand, we get the below file dependency-reduced-pom.xml . My question is, what is the purpose of creating this file besides pom.xml file? 回答1: If you set to true the flag createDependencyReducedPom (by default is true), the dependencies that have been included into the uber JAR will be removed from the <dependencies> section of the generated POM. The reduced POM will

Spring 3 NamespaceHandler issues with Maven Shade plugin

安稳与你 提交于 2019-11-28 07:24:50
问题 Spring 3.1.1.RELEASE with Apache Maven 3.0.3 and Maven Shade plugin 1.6. Using the mvn shade plugin to package the artifact in an uber-jar, including its dependencies: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>1.6</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource

How to include test classes in Jar created by maven-shade-plugin?

橙三吉。 提交于 2019-11-28 06:17:54
I'm trying to package my test classes in to an executable jar with dependencies using Maven, but I'm struggling to get this right. This is my pom.xml so far: <project> <modelVersion>4.0.0</modelVersion> <groupId>com.c0deattack</groupId> <artifactId>executable-tests</artifactId> <version>1.0</version> <packaging>jar</packaging> <name>executable-tests</name> <dependencies> <dependency> <groupId>info.cukes</groupId> <artifactId>cucumber-java</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>info.cukes</groupId> <artifactId>cucumber-junit</artifactId> <version>1.0.0<