maven-shade-plugin

Maven Shade Plugin not including resources of dependency

僤鯓⒐⒋嵵緔 提交于 2019-12-11 10:44:17
问题 I'm using the Maven Shade Plugin to include all dependencies during package phase. That works fine for classes, but dependent resources aren't included. Here's the layout of the dependent jar: ./config.properties <-- this is the missing resource ./META-INF ./META-INF/MANIFEST.MF ./META-INF/maven ./META-INF/maven/com.example ./META-INF/maven/com.example/bar ./META-INF/maven/com.example/bar/pom.properties ./META-INF/maven/com.example/bar/pom.xml Here's the shade plugin configuration: <plugin>

Maven Shade Plugin + Launch4j

孤街浪徒 提交于 2019-12-11 04:46:17
问题 I have two maven projects inside the same folder. One is dependent upon other i.e. has the other one it its dependencies. Now I would like to use maven shade plugin and launch4j but it seems to complicated to me. Can somebody give me a step by step explanation for my case? So I have 2 POM files, one in each project. My multi-module file looks like this: <project xmlns="http://maven.apache.org/POM/4.0.0 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven

maven-shade-plugin reports: Error creating shaded jar: …target/classes (Is a directory)

家住魔仙堡 提交于 2019-12-11 01:06:15
问题 When running a Maven build in eclipse using the m2eclipse tooling for a project that is configured for the Maven Shade Plugin, the build fails with the following error message: Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.4.3:shade (default) on project xxx: Error creating shaded jar: /.../project/target/classes (Is a directory) -> [Help 1] I tried different versions of the Shade plugin and tried with different Java versions (6,7,8). All lead to the same error.

Maven: compile a project using shade-plugin specifying main class and properties file

拈花ヽ惹草 提交于 2019-12-10 22:33:53
问题 New to Maven, I was trying to compile a project using Maven with maven-shade-plugin (as it seems the best plugin to build a fat jar out there). I tried to specify my main class to make a runnable jar file and some .properties files which contains translation strings. Compilation and build seems passed, according to netbeans output, but I can't run it as following (assuming the jar built by Maven is renamed "program"): /usr/bin/java -cp program.jar bot.Main > could not find or load main class

Prevent maven-shade-plugin from exposing <system> dependency?

僤鯓⒐⒋嵵緔 提交于 2019-12-10 17:39:25
问题 Thanks to a separate thread, I realized my project's uber-jar had a bug. I create the uber-jar using maven-shade-plugin because I need the more advanced transformer capabilities to merge several ServiceLoader definitions. So, the issue is that my project has a system-scope compile-time dependency on tools.jar , locating tools.jar on the local machine relative to the value of the java.home sysprop. The bug is that I didn't realize this dependency was: leaking into the dependency-reduced pom

Cannot find 'resource' in class org.apache.maven.plugins.shade.resource.ManifestResourceTransformer

人走茶凉 提交于 2019-12-10 10:57:55
问题 when my use maven-shade-plugin package a execute jar, then Failed, and print error message: Cannot find 'resource' in class org.apache.maven.plugins.shade.resource.ManifestResourceTransformer follow is my config: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>3.0.0</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <transformers> <transformer implementation="org.apache.maven

How to stop maven-shade-plugin from blocking java.util.ServiceLoader initialization of opensaml-impl types

吃可爱长大的小学妹 提交于 2019-12-10 09:45:52
问题 When using OpenSAML 3, you must first load components from the opensaml-saml-impl artifact with the following line of code: InitializationService.initialize(); This uses java.util.ServiceLoader to load any type which implements Initializer. When I write a test and run it with mvn integration-test , this works fine, and I can see that everything has loaded: Assert.assertTrue( XMLObjectProviderRegistrySupport .getUnmarshallerFactory() .getUnmarshallers() .size() > 400); However, my project uses

Including a non-Mavenized dependency so it works with maven-shade-plugin

本秂侑毒 提交于 2019-12-09 12:22:41
问题 I want to include GData Client, which doesn't use Maven, as a dependency into my Maven project. It ships as a bunch of JAR files. Additionaly, I use Maven Shade Plugin to build an executable JAR without any external dependencies (with the default configuration, no renaming/including/excluding/transforming of dependencies). How can I do that? (Just adding the JARs as resources wouldn't work, since the Shade plugin must extract them). 回答1: you want to check the maven docs on installing 3rd

m2e shade eclipse “project main artifact does not exist”

非 Y 不嫁゛ 提交于 2019-12-09 07:13:08
问题 I'm trying to make a deployment package that bundles all the dependencies of my maven module that has dependencies to another maven project in eclipse. I have this in my pom.xml <modelVersion>4.0.0</modelVersion> <groupId>com.my.proj</groupId> <artifactId>AAA</artifactId> <version>0.0.2-SNAPSHOT</version> <name>btc</name> <dependencies> <dependency> <groupId>com.another.proj</groupId> <artifactId>BBB</artifactId> <version>1.4-SNAPSHOT</version> </dependency> </dependencies> <build> <plugins>

log4j2 ERROR StatusLogger Unrecognized conversion specifier

China☆狼群 提交于 2019-12-08 16:01:18
问题 I have log4j2 in my project when I run main method in intellij Idea ,it correct to print log. when i use maven-shade-plugin package project to jar file, and run jar as standalone application it shows error: java -cp package.jar com.xxx.TestMain the console output ERROR StatusLogger Unrecognized format specifier [d] ERROR StatusLogger Unrecognized conversion specifier [d] starting at position 16 in conversion pattern. ERROR StatusLogger Unrecognized format specifier [thread] ERROR StatusLogger