I use Eclipse IDE in conjunction with Gradle. I stumbled over a problem with the packaging in the Runnable Jar of the library connected to the project — it does not appear in the jar. To get it, use the 'build' command.
When a Runnable Jar is received via the standard environment tools (Ant), all classes from the library appear in the 'com' folder and the jar is launched. But besides them, there is a lot of excess garbage, which does not affect anything, but it weighs a lot. Yes, and I do not want to throw Gradle. Through Gradle, neither classes nor, accordingly, the starting jar fails.
My build.gradle
apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'application' mainClassName = 'formatter.MainView' jar { baseName = 'PostMaker ' version = ' v2.0 Alpha' manifest.attributes("Main-Class": mainClassName); manifest.attributes("Class-Path": '.'); } repositories { mavenCentral() } dependencies { compile group: 'commons-collections', name: 'commons-collections', version: '3.2' compile 'com.mpatric:mp3agic:0.8.4' testCompile group: 'junit', name: 'junit', version: '4.+' } test { systemProperties 'property': 'value' } uploadArchives { repositories { flatDir { dirs 'repos' } } } task wrapper(type: Wrapper) { gradleVersion = '2.10' }