maven-shade-plugin

maven shaded jar: change output location

微笑、不失礼 提交于 2019-12-21 05:28:04
问题 I'm having difficulty using the Maven Shade Plugin because I would like to have my shaded jar be installed to the same folder as the Parent pom (instead of the local src/target directory). The layout: maven_project guide/ parent_pom.xml projA/ pom.xml projB/ pom.xml /target original-projB-0.0.3.jar projB-0.0.3.jar (shaded jar) I have to export the project and to make it easier for others to run the executable jar I want to relocate the shaded jar to the guide folder. Unfortunately, I tried

Maven can't compile java 1.8

主宰稳场 提交于 2019-12-20 11:56:15
问题 I'm trying to use maven to build a jar but I keep getting the error ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Application: Fatal error compiling: invalid target release: 1.8 -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible

How to configure Maven shade plugin in a multi-module project?

让人想犯罪 __ 提交于 2019-12-20 09:55:58
问题 everyone! I have been trying to get jar using Maven Shade Plugin, but I still don't get a success :( That's my project structure: MainModule -Module1 -src -pom.xml -Module2 -src -pom.xml -pom.xml Module1 (pom.xml): <parent> <artifactId>MainModule</artifactId> <groupId>com.plugintest</groupId> <version>1.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>Module1</artifactId> Module2 (pom.xml): <parent> <artifactId>MainModule</artifactId> <groupId>com.plugintest<

Is dependency-reduced-pom.xml automatically used instead of pom.xml?

左心房为你撑大大i 提交于 2019-12-18 14:04:45
问题 Is dependency-reduced-pom.xml created by Maven shade plugin automatically used in projects that depends on the uberjar (instead of the ordinary pom.xml )? Asking this after reading a number of dependency-reduced-pom.xml related questions and haven't founding the answer: Maven shade plugin adding dependency-reduced-pom.xml to base directory What is the purpose of dependency-reduced-pom.xml generated by the shade plugin? What is `dependency-reduced-pom.xml` file which created when calling maven

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

主宰稳场 提交于 2019-12-18 04:08:25
问题 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? 回答1: I had the same problem. It was fixed by making my artifact selector more specific, e.g. <artifact>bouncycastle:*<

Why does Maven shade plugin remove module-info.class?

走远了吗. 提交于 2019-12-13 13:00:38
问题 I try to use maven-shade-plugin for a modular jar: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>3.1.1</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> </execution> </executions> <configuration> <minimizeJar>true</minimizeJar> <artifactSet> <includes> <include>javax.xml.bind:jaxb-api</include> <include>com.sun.xml.bind:jaxb-impl</include> </includes> </artifactSet> <relocations>

How can I configure the maven shade plugin to include test code in my jar?

◇◆丶佛笑我妖孽 提交于 2019-12-13 12:25:14
问题 I use the shade maven plugin to build my project so that all of its dependencies are included in one jar (this makes it easier to run it on Hadoop). Shade seems to exclude my test code by default, which is understandable. Since I would like to run integration tests against my cluster, I am hoping to setup another profile to build a separate jar for this purpose. Is there any way to configure this plugin to also include test code? 回答1: With version 2.2 of the maven-shade-plugin, they added a

Shade Plugin Harcording Dependency For Excluded Artifact also

狂风中的少年 提交于 2019-12-13 07:35:53
问题 I have the following shade plugin config : <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>2.2</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <createSourcesJar>false</createSourcesJar> <keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope> <promoteTransitiveDependencies>true</promoteTransitiveDependencies> <artifactSet> <includes>

Error creating shaded jar: null: IllegalArgumentException

一笑奈何 提交于 2019-12-12 10:58:08
问题 I'm using ASM 6.1 in my project to generate Class files dynamically. But I have a problem when assembling a fat jar. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.4.3:shade (default-cli) on project uetlx: Error creating shaded jar: null: IllegalArgumentException -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.4.3:shade (default-cli) on project uetlx: Error creating shaded

Downsides of using Shade plugin relocation feature

痞子三分冷 提交于 2019-12-12 01:14:57
问题 To resolve jar conflicts in my application, I use the shaded plugin's relocation feature. It works for me, but i feel it is a hack. I would like to understand the downsides of using the relocation feature if any. 回答1: The main issue is that it can fail in cases where the package name is directly defined (not just imported). For example, if you are using reflection and instantiating the a class by its name (including the package name) it will generate the wrong one. Similar problems can occur