uberjar

Gradle shadow jar with conflicting dependencies

自闭症网瘾萝莉.ら 提交于 2019-12-11 05:28:10
问题 I'm playing with the idea of creating uber jars for my services but I'm worried about including jars that have conflicting dependencies. What happens when jar A depends on slf4j-1.0 and jar B depends on slf4j-2.0 and there were major changes between 1.0 and 2.0? When those jars both get included in the uber jar do I have to write specific filters by namespace or does something happen during the shadow process that namespaces the jars? thanks for the help 回答1: You are correct to worry. You end

maven - How to build uberjars with dependencies

天大地大妈咪最大 提交于 2019-12-11 03:50:09
问题 I have a maven module generating a jar file. I have been asked to develop a couple of other uberjar files as a byproduct of build process. I have also been told these 2 jar files are applet jar files that will be need include some classes from the dependencies of the maven module. I looked around and narrowed down to these 3 options - Maven Assembly plugin - This can build custom jars from the classes generated by the maven module. Third party dependencies cant be included. Use ant through

how to add a hook into the uberjar process (building with lein)

坚强是说给别人听的谎言 提交于 2019-12-10 16:10:39
问题 i would like to add a hook to the uberjar process. the specific example is to download the maxmind geoip dat file into the resources folder so an updated version is bundled into the jar every time it deploys. examples/suggestions appreciated thanks! 回答1: I recommend making a custom lein task that calls uberjar, rather than using a hook. For example, if your project is called foo: file: foo/tasks/leiningen/foobuild.clj (ns leiningen.foobuild (:require leiningen.uberjar)) (defn foobuild

Clojure Uberjar not loading resource file

丶灬走出姿态 提交于 2019-12-10 14:42:13
问题 I use lein uberjar to create a standalone jar of an application. When executing java -jar dataloader-0.1.0-SNAPSHOT-standalone.jar, it crashes with: Caused by: java.lang.IllegalArgumentException: Not a file: jar:file:dataloader-0.1.0-SNAPSHOT-standalone.jar!/configuration.json I load the file via: (ns dataloader.configuration (:gen-class) (:require [cheshire.core :refer :all] [clojure.java.io :as io])) (def data-file (io/file (io/resource "configuration.json"))) project.clj (defproject

Unable to instrument apache httpclient using javaagent for spring boot uber jar application

a 夏天 提交于 2019-12-09 23:06:03
问题 I'm trying to write a javaagent with Bytebuddy to intercept apache httpclient requests and I want to use this agent for spring boot application. The agent works fine when I start my test spring boot application from Idea (run the main method directly). However, when I package the application into a spring boot uber jar and run it using java -javaagent:myagent.jar -jar myapplication.jar , it throws the following exception. onError:org.apache.http.impl.client.AbstractHttpClient java.lang

specify Kotlin class as the Main-Class entry point in a MANIFEST.MF?

本秂侑毒 提交于 2019-12-08 06:35:54
问题 How do I explicitly tell shadowJar to use a Kotlin file as the entry point for the resulting uberJar ? (Or, fat JAR as you prefer.) clumsily editing META-INF/MANIFEST.MF and the replacing it in the zip file (used the GUI to put it back): thufir@dur:~/NetBeansProjects/kotlin/build/libs$ thufir@dur:~/NetBeansProjects/kotlin/build/libs$ ll total 900 drwxrwxr-x 2 thufir thufir 4096 Nov 5 03:42 ./ drwxrwxr-x 8 thufir thufir 4096 Nov 5 03:42 ../ -rw-rw-r-- 1 thufir thufir 903184 Nov 5 03:42

how to create fat jar which does not overwrite entries under META-INF/services

喜欢而已 提交于 2019-12-07 21:57:00
问题 I have the following gradle build config: plugins { id 'com.github.johnrengelman.shadow' version '1.2.3' } group 'abc' version '1.0-SNAPSHOT' apply plugin: 'java' apply plugin: 'application' mainClassName = "abc.Driver" repositories { mavenCentral() } dependencies { compile (group: 'org.apache.hadoop', name: 'hadoop-client', version: '2.6.0') } sourceSets { main { java { srcDir './src' } } } jar { manifest { attributes( 'Class-Path': configurations.compile.collect { it.getName() }.join(' '),

How To Specify main class when using fatjar plugin in gradle.build

我怕爱的太早我们不能终老 提交于 2019-12-06 18:33:37
问题 I am interested in building a single jar containing all the module dependencies and external jars in a single executable jar file which I will be able to run with java -jar myApp.jar . I have module A which is dependent on module B. Currently I'm using gradle, and my build.gradle script looks like this: apply plugin: 'fatjar' description = "A_Project" dependencies { compile project(':B_Project') compile "com.someExternalDependency::3.0" } When I build it through gradle command: clean build

how to create fat jar which does not overwrite entries under META-INF/services

Deadly 提交于 2019-12-06 06:29:25
I have the following gradle build config: plugins { id 'com.github.johnrengelman.shadow' version '1.2.3' } group 'abc' version '1.0-SNAPSHOT' apply plugin: 'java' apply plugin: 'application' mainClassName = "abc.Driver" repositories { mavenCentral() } dependencies { compile (group: 'org.apache.hadoop', name: 'hadoop-client', version: '2.6.0') } sourceSets { main { java { srcDir './src' } } } jar { manifest { attributes( 'Class-Path': configurations.compile.collect { it.getName() }.join(' '), 'Main-Class': mainClassName ) } } task fatJar(type: Jar) { manifest { attributes 'Implementation-Title'

Unable to instrument apache httpclient using javaagent for spring boot uber jar application

旧城冷巷雨未停 提交于 2019-12-04 17:54:08
I'm trying to write a javaagent with Bytebuddy to intercept apache httpclient requests and I want to use this agent for spring boot application. The agent works fine when I start my test spring boot application from Idea (run the main method directly). However, when I package the application into a spring boot uber jar and run it using java -javaagent:myagent.jar -jar myapplication.jar , it throws the following exception. onError:org.apache.http.impl.client.AbstractHttpClient java.lang.NoClassDefFoundError: org/apache/http/HttpHost at java.lang.Class.getDeclaredMethods0(Native Method) at java