maven-shade-plugin

Refactoring import statements using Shade relocations in Maven

∥☆過路亽.° 提交于 2020-03-03 07:00:11
问题 I've been using Shade to relocate a dependency from com.package.x to com.package.y ; when I build with Maven, it complains due to incompatible types - so I have to change my import statements inside my code to match com.package.y . Is this really the only way to go about this? Changing the imports is making IntelliJ complain and basically breaks IDE integration. Is there no way Shade can modify the imports? 回答1: The main use case of the shade plugin is to generate an uber-jar while relocating

Apache Spark — using spark-submit throws a NoSuchMethodError

浪子不回头ぞ 提交于 2020-02-20 04:47:20
问题 To submit a Spark application to a cluster, their documentation notes: To do this, create an assembly jar (or “uber” jar) containing your code and its dependencies. Both sbt and Maven have assembly plugins. When creating assembly jars, list Spark and Hadoop as provided dependencies; these need not be bundled since they are provided by the cluster manager at runtime. -- http://spark.apache.org/docs/latest/submitting-applications.html So, I added the Apache Maven Shade Plugin to my pom.xml file

Apache Spark — using spark-submit throws a NoSuchMethodError

本小妞迷上赌 提交于 2020-02-20 04:44:33
问题 To submit a Spark application to a cluster, their documentation notes: To do this, create an assembly jar (or “uber” jar) containing your code and its dependencies. Both sbt and Maven have assembly plugins. When creating assembly jars, list Spark and Hadoop as provided dependencies; these need not be bundled since they are provided by the cluster manager at runtime. -- http://spark.apache.org/docs/latest/submitting-applications.html So, I added the Apache Maven Shade Plugin to my pom.xml file

Create jar with dependencies and excluding specific source files

你离开我真会死。 提交于 2020-01-25 15:15:50
问题 I would like to use Maven to create a jar that includes a specific dependent artifact and excludes some of the source java files. Currently I use this snippet: <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <executions> <execution> <id>shadedJar</id> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <shadedClassifierName>classifier</shadedClassifierName> <shadedArtifactAttached>true</shadedArtifactAttached>

Create jar with dependencies and excluding specific source files

眉间皱痕 提交于 2020-01-25 15:14:24
问题 I would like to use Maven to create a jar that includes a specific dependent artifact and excludes some of the source java files. Currently I use this snippet: <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <executions> <execution> <id>shadedJar</id> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <shadedClassifierName>classifier</shadedClassifierName> <shadedArtifactAttached>true</shadedArtifactAttached>

Why does relocation with the maven shade plugin not work?

瘦欲@ 提交于 2020-01-22 18:24:08
问题 I am having some trouble running a Hadoop job that includes a newer version of Guava than the one that is included in the Hadoop distribution (CDH 5.2). This is a known problem. I try to solve it by shading the libraries using the Maven shade plugin. Therefore, I added the following lines to my pom.xml : <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>2.3</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade<

Spring with maven-shade-plugin

爷,独闯天下 提交于 2020-01-16 19:17:29
问题 I am trying to use to versions of spring in the same application: the first one is a webapp with spring 2.6 and the second it a jar client, with spring 4.0.2. The client communicates with another application and will be a dependency for the webapp. The problem is that the classloader will just load one time the common classes from spring and it will certainly fail. I tried to use ElasticSearch aproach of using shaded dependencies(maven shade plugin) and relocate spring from the client to a

Spring with maven-shade-plugin

我的梦境 提交于 2020-01-16 19:17:13
问题 I am trying to use to versions of spring in the same application: the first one is a webapp with spring 2.6 and the second it a jar client, with spring 4.0.2. The client communicates with another application and will be a dependency for the webapp. The problem is that the classloader will just load one time the common classes from spring and it will certainly fail. I tried to use ElasticSearch aproach of using shaded dependencies(maven shade plugin) and relocate spring from the client to a

maven-shade-plugin : make a jar whereas we are in war Project?

◇◆丶佛笑我妖孽 提交于 2020-01-15 12:24:05
问题 Question is in the title. I sucess to first to do a jar (project packaging jar)....then i move it before id do mvn clean to keep it elsewhere. Or i'm a in a war project so i have to rename project packaging to war then i have to do a mvn clean install I got my war. I then import the first jar to use from my war. Is there a clearer way do that with maven shade plugin to generate both war and jar. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId>

maven-shade-plugin : make a jar whereas we are in war Project?

▼魔方 西西 提交于 2020-01-15 12:22:08
问题 Question is in the title. I sucess to first to do a jar (project packaging jar)....then i move it before id do mvn clean to keep it elsewhere. Or i'm a in a war project so i have to rename project packaging to war then i have to do a mvn clean install I got my war. I then import the first jar to use from my war. Is there a clearer way do that with maven shade plugin to generate both war and jar. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId>