Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
pmendelski committed Feb 20, 2021
1 parent 31226bf commit 80d6e82
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,12 @@ manifest {

See Java tutorial
on [Adding Classes and Jars to Jar File's Classpath](https://docs.oracle.com/javase/tutorial/deployment/jar/downman.html)

## Reading `MANIFEST.MF` from project

Take a look at a [gradle-manifest-plugin-sample](https://github.com/coditory/gradle-manifest-plugin-sample).
You can copy [ManifestReader.java](https://github.com/coditory/gradle-manifest-plugin-sample/blob/master/src/main/java/com/coditory/sandbox/ManifestReader.java) (with [tests](https://github.com/coditory/gradle-manifest-plugin-sample/blob/master/src/test/groovy/com/coditory/sandbox/ManifestReaderTest.groovy)) to you own project.

Reading `MANIFEST.MF` is tricky. There can be mupltiple `MANIFEST.MF` files on the classpath that comes from libraries.
To read the correct `MANIFEST.MF` you need to filter them. Most often `Implementation-Title` is used to find the correct one.

0 comments on commit 80d6e82

Please sign in to comment.