Last active
February 15, 2022 06:14
-
-
Save simon04/6865179 to your computer and use it in GitHub Desktop.
Revisions
-
simon04 revised this gist
Oct 30, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ I struggled with with the jar MANIFEST file built with Gradle containing an empt Wrong (`jar` before `dependencies`): ```gradle jar { manifest.attributes( // Class-Path won't contain "guava-15.0.jar" @@ -23,7 +23,7 @@ dependencies { ``` Correct (`jar` after `dependencies`): ```gradle repositories { mavenCentral() } -
simon04 created this gist
Oct 7, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ Gradle, Java plugin, Jar MANIFEST, Class-Path is empty ====================================================== I struggled with with the jar MANIFEST file built with Gradle containing an empty `Class-Path`. I traced down the problem to the order of the `dependencies` and `jar` blocks in the `build.gradle` file: Wrong (`jar` before `dependencies`): ``` jar { manifest.attributes( // Class-Path won't contain "guava-15.0.jar" 'Class-Path': configurations.runtime.files.collect { it.name }.join(' ') ) } repositories { mavenCentral() } dependencies { compile group: 'com.google.guava', name: 'guava', version: '15.0' } ``` Correct (`jar` after `dependencies`): ``` repositories { mavenCentral() } dependencies { compile group: 'com.google.guava', name: 'guava', version: '15.0' } jar { manifest.attributes( // results in "Class-Path: guava-15.0.jar" 'Class-Path': configurations.runtime.files.collect { it.name }.join(' ') ) } ```