uberjar

How to build an Uber JAR (Fat JAR) using SBT within IntelliJ IDEA?

[亡魂溺海] 提交于 2019-11-26 10:12:47
I'm using SBT (within IntelliJ IDEA) to build a simple Scala project. I would like to know what is the simplest way to build an Uber JAR file (aka Fat JAR, Super JAR). I'm currently using SBT but when I'm submiting my JAR file to Apache Spark I get the following error: Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes Or this error during compilation time: java.lang.RuntimeException: deduplicate: different file contents found in the following: PATH\DEPENDENCY.jar:META-INF/DEPENDENCIES PATH\DEPENDENCY.jar:META-INF/MANIFEST.MF It

Building a uberjar with Gradle

丶灬走出姿态 提交于 2019-11-26 07:34:12
问题 I am a Gradle novice. I want to build a uberjar (AKA fatjar) that includes all the transitive dependencies of the project. What lines do I need to add to my \"build.gradle\"? This is what I currently have: (I copied it from somewhere a few days back, but don\'t recollect from where.) task uberjar(type: Jar) { from files(sourceSets.main.output.classesDir) manifest { attributes \'Implementation-Title\': \'Foobar\', \'Implementation-Version\': version, \'Built-By\': System.getProperty(\'user

Is it possible to create an “uber” jar containing the project classes and the project dependencies as jars with a custom manifest file?

孤者浪人 提交于 2019-11-26 02:33:35
问题 I\'m trying to create a executable jar(using maven) that contains the project classes and it\'s dependencies with a manifest file that has the entry for the main class and the class path entry that points to the dependencies packed in the root of the jar;something like this : Manifest File: ..... Main-Class : com.acme.MainClass Class-Path : dependecy1.jar dependecy2.jar ..... Jar: jar-root |-- .... |-- com/acme/../*.class |-- dependecy1.jar `-- dependecy2.jar I\'m using the maven-jar-plugin

How to build an Uber JAR (Fat JAR) using SBT within IntelliJ IDEA?

天涯浪子 提交于 2019-11-26 01:49:04
问题 I\'m using SBT (within IntelliJ IDEA) to build a simple Scala project. I would like to know what is the simplest way to build an Uber JAR file (aka Fat JAR, Super JAR). I\'m currently using SBT but when I\'m submiting my JAR file to Apache Spark I get the following error: Exception in thread \"main\" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes Or this error during compilation time: java.lang.RuntimeException: deduplicate: different file contents

Easiest way to merge a release into one JAR file

狂风中的少年 提交于 2019-11-26 01:37:22
问题 Is there a tool or script which easily merges a bunch of JAR files into one JAR file? A bonus would be to easily set the main-file manifest and make it executable. The concrete case is a Java restructured text tool. I would like to run it with something like: java -jar rst.jar As far as I can tell, it has no dependencies which indicates that it shouldn\'t be an easy single-file tool, but the downloaded ZIP file contains a lot of libraries. 0 11-30-07 10:01 jrst-0.8.1/ 922 11-30-07 09:53 jrst

What is a fat JAR?

落爺英雄遲暮 提交于 2019-11-26 01:29:42
问题 I\'ve heard people say that they create a fat JAR and deploy it. What do they actually mean ? 回答1: The fat jar is the jar, which contains classes from all the libraries, on which your project depends and, of course, the classes of current project. In different build systems fat jar is created differently, for example, in Gradle one would create it with (instruction): task fatJar(type: Jar) { manifest { attributes 'Main-Class': 'com.example.Main' } baseName = project.name + '-all' from {

Using Gradle to build a jar with dependencies

℡╲_俬逩灬. 提交于 2019-11-26 00:37:08
问题 I have a multiproject build and I put a task to build a fat jar in one of the subprojects. I created the task similar to the one described in the cookbook. jar { from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } manifest { attributes \'Main-Class\': \'com.benmccann.gradle.test.WebServer\' } } Running it results in the following error: Cause: You can\'t change a configuration which is not in unresolved state! I\'m not sure what this error means. I also reported this

What is an uber jar?

前提是你 提交于 2019-11-25 23:36:27
问题 I am reading Maven documentation and came across the name \'uber-jar\'. What does an uber-jar mean and what are its features/advantages? 回答1: Über is the German word for above or over , as in a line from a previous national anthem: Deutschland, Deutschland, über alles (Germany, Germany above all else). Hence, in this context, an uber-jar is an "over-jar", one level up from a simple "jar", defined as one that contains both your package and all its dependencies in one single JAR file. The name