executable-jar

Exclude a specific dependency from springBoots `bootJar` gradle task

此生再无相见时 提交于 2020-12-06 02:39:51
问题 I need to exclude a specific dependency from springBoots bootJar gradle task (similar to the provided scope in maven). I tried a custom configuration, but the dependency-which-should-not-be-in-bootJar is still included in the resulting jar. configurations{ provided implementation.extendsFrom provided } dependencies { // ... provided "dependency-which-should-not-be-in-bootJar" } jar { from configurations.compile - configurations.provided from configurations.runtime } bootJar { from

Use of Gradle Kotlin DSL Jar.from()

≯℡__Kan透↙ 提交于 2020-06-29 04:00:10
问题 I'm trying to include a single source file for the Main-Class of a jar -- actually I have a toplevel directory of such files, demo/ , but I don't want them all in a jar. I want separate jars, each using only one of these. This seems like sort of an anti-pattern in gradle, as the fundamental mechanism infers or prefers that I should instead place each in a distinct sourceSet . Ugh. A casual reading of the docs implies Jar.from() might be useful this way: "Specifies the source files or

How to exclude certain dependencies from being added to the Class-Path in maven?

前提是你 提交于 2020-06-17 09:43:24
问题 I'm using maven to build an executable JAR and I want to add all dependencies minus a select few to the Class-Path of my MANIFEST.MF . So far I'm using the maven-jar-plugin for this: <!-- Add dependent JARs to the classpath --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifest> <addClasspath>true</addClasspath> <classpathPrefix>libraries</classpathPrefix> <mainClass>MyMainClass</mainClass> </manifest>

Error when creating an executable test-jar in Maven

眉间皱痕 提交于 2020-03-05 02:56:27
问题 I'm trying to create a JAR that I can put on a non development machine and run some unit tests that exercise a web service. I've read that there are many ways to do this in maven. I'm focusing on using the test-jar goal because that seems the most logical approach. My tests are in a separate maven project with a folder structure of: /myProject/src/test/java/org/testplatform/services/test/<name of testng test>.java Here is my config for the test-jar in the pom: <plugin> <groupId>org.apache

Runnable jar exported with eclipse isn't working, in eclipse it still works

你离开我真会死。 提交于 2020-01-25 20:55:08
问题 I'm trying to export a java project in eclipse as a runnable jar, but for some reason the runnable jar doesn't work. If I double click the executable jar, it doesn't do anything. I tried both extract and package required libraries into generated jar. So I also tried to export some simpler projects, those worked fine. The biggest difference is my real project has files: images and xml files. In code reference them like this: File file = new File("Recources/test.xml"); ImageIcon imageIcon = new

Running java runnable JAR

痴心易碎 提交于 2020-01-25 06:39:19
问题 I have created JavaFX app with OpenJDK13 and OpenJFX13. In Eclipse I have made Runnable JAR but it doesn't work (at least on my Win 10 installation) unless I add VM arguments in command line. So, to fix this I made *.bat file with text: java -jar --module-path "C:\Java\javafx-sdk-13.0.1\lib" --add-modules javafx.controls,javafx.fxml Testing.jar It working that way. But, there is 2 things about my solution I would like to change. Is there any way to avoid Command prompt being shown when

How to include resource folder in executable .jar file in eclipse?

廉价感情. 提交于 2020-01-24 09:57:04
问题 I need to create an application for sorting various types of polygons using various parameters such as height, volume or base area. Arguments for Filename which has parameters for polygons, Sort type, Sort method will be pass through command line.That file is in my resource folder outside my src folder in a project. I have implemented all programs, It works fine when I run using pass arguments through eclipse run configuration. But when I try to run my .jar file using cmd same arguments it

MongoDB with java Exception in thread “main” java.lang.NoClassDefFoundError: org/bson/conversions/Bson

风格不统一 提交于 2020-01-23 22:16:21
问题 When I execute mycode from intelliJ Idea it works fine but when I run the jar on my server it throws the below error. I am using 'org.mongodb:mongodb-driver:3.4.1' version. Exception in thread "main" java.lang.NoClassDefFoundError: org/bson/conversions/Bson at com.myapp.server.mongo.MongoDbHandler.prepareMongoDb(MongoDbHandler.java:68) at com.myapp.server.mongo.MongoDbHandler.<init>(MongoDbHandler.java:22) at com.myapp.server.Client.main(Client.java:167) Caused by: java.lang