How to specify the entry point, Main-Class, for a FatJar using Gradle Kotlin DSL?

百般思念 提交于 2020-01-11 13:24:33
问题 How do I specify the Main-Class attribute in the ShadowJar once it's imported? import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar plugins { kotlin("jvm") version "1.2.51" id("com.github.johnrengelman.shadow") version "2.0.4" } group = "xxx.yyy" version = "1.0-SNAPSHOT" repositories { mavenCentral() } dependencies { implementation(kotlin("stdlib-jdk8")) } tasks.withType<KotlinCompile> { kotlinOptions.jvmTarget = "1.8" }

Running Spring boot fat JAR

安稳与你 提交于 2020-01-06 19:34:44
问题 C:\Users\sinpik\Desktop\jar\extract>java -jar PackageProject-client.jar java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53) at java.lang.Thread.run(Unknown Source) Caused by: java

Do we still have to make a fat jar for submitting jobs in Spark 2.0.0?

拥有回忆 提交于 2020-01-03 09:57:08
问题 In the Spark 2.0.0's release note, it says that: Spark 2.0 no longer requires a fat assembly jar for production deployment. Does this mean that we do not need to make a fat jar anymore for submitting jobs ? If yes, how ? Thus the documentation here isn't up-to-date. 回答1: Does this mean that we do not need to make a fat jar anymore for submitting jobs ? Sadly, no. You still have to create an uber JARs for Sparks deployment. The title from the release notes is very misleading. The actual

Maven: how to do runable jar (uberjar) with included external libraries

走远了吗. 提交于 2019-12-24 14:48:34
问题 Until now i made runnable jars with Ant and there were no problems with it. However i now try to mavenize my project and i realy can't figured out how to do runable jar with this tool. I've read tons of tutorials (also here, on Stackoverflow), helps, advices and... nothing. In my case all of them don't work which probably means i don't understand some basics. I have such simple project: This is app, witch use mysql-connector-java-5.1.24-bin.jar (placed in 'lib' dir) to connect to MySQL

Executable Jar: JMSCC0091: The provider factory for connection type 'com.ibm.msg.client.wmq' could not be loaded

落花浮王杯 提交于 2019-12-24 14:24:05
问题 I encountered this very weird problem while working on using JMSTemplate to connect to IBM Websphere MQ. The code runs perfectly fine in Eclipse, but when I use shade plugin to package the project and all the dependencies into an Uber jar, I got this error while executing the jar file: com.ibm.msg.client.jms.DetailedJMSException: JMSCC0091: The provider factory for connection type 'com.ibm.msg.client.wmq' could not be loaded. at sun.reflect.GeneratedConstructorAccessor4.newInstance(Unknown

java runtime exception: “could not find writer for content type” when building uberjar and zip package

时间秒杀一切 提交于 2019-12-24 01:19:39
问题 When using the maven assembly plugin to build an uberjar and then package it into a zip file, I encounter a runtime failure: java.lang.RuntimeException: could not find writer for content-type text/xml type: java.lang.String This failure does not occur when I run my project within eclipse, or when I create and executable .jar using the eclipse Export -> Runnable Jar File so I suspect there is something wrong with the way I'm using maven creating the uberjar. How do I fix this problem? 回答1:

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>

maven build error: Error creating shaded jar (Access denied)

浪尽此生 提交于 2019-12-12 14:27:47
问题 I get the following error trying to make an uberjar with maven, any ideas what might be going on? [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Error creating shaded jar: C:\Projects\info\binf\target\classes (Access is denied) 回答1: It seems like that target folder is in used by some other process. Try to delete the folder manually and see if you are able

How can I conditionally load functionality in a clojure web-app

六眼飞鱼酱① 提交于 2019-12-12 06:17:15
问题 I have a clojure web app (standard ring handlers and compojure routes on a jetty server) for which I enabled live asset recompilation as middleware, which has been very very handy in development. As we get closer to production I would like to find a way not to load that code in production and instead read the pre-compiled assets (which I am able to generate as a lein task). Currently the asset compilation machinery lives in the project code - it can be loaded from the lein task using eval-in

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