# Macro to get list of files inside a jar?

**URL:** <https://bnd.discourse.group/t/macro-to-get-list-of-files-inside-a-jar/471>\
**Category:** GENERAL\
**Created:** [September 29, 2024, 8:56am UTC](https://bnd.discourse.group/t/macro-to-get-list-of-files-inside-a-jar/471 "2024-09-29T08:56:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisrueger](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/chrisrueger/32/18_2.png) [@chrisrueger](https://bnd.discourse.group/u/chrisrueger)\
**Post date:** [September 29, 2024, 8:56am UTC](https://bnd.discourse.group/t/macro-to-get-list-of-files-inside-a-jar/471/1 "2024-09-29T08:56:57Z")

</div>

Is there macro (or combination of macros) to get a list of filenames inside a jar? Basically what I would like to get is the same what `-includeresource` is doing when unrolling a jar. But I want to have it as a list to process it further e.g. with ${lsr} macro etc.

Example:  
`-includeresource META-INF/services=@lib/groovy-3.0.22.jar!/META-INF/services/*;flatten:=true`

extracts the file `org.codehaus.groovy.transform.ASTTransformation` inside the resulting JAR in META-INF/services

I have found [extract [options] … | bnd](https://bnd.bndtools.org/commands/extract.html) but it does not seem to be available as a macro in a `.bnd` file

Do we have something like this?

---

<div class="post-metadata">

**Author:** ![pkriens](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/pkriens/32/3_2.png) [@pkriens](https://bnd.discourse.group/u/pkriens)\
**Post date:** [October 1, 2024, 12:18pm UTC](https://bnd.discourse.group/t/macro-to-get-list-of-files-inside-a-jar/471/2 "2024-10-01T12:18:41Z")

</div>

Not that I am aware of …
