# Copying all required bundles to directory

**URL:** <https://bnd.discourse.group/t/copying-all-required-bundles-to-directory/287>\
**Category:** GENERAL\
**Created:** [January 30, 2023, 11:45am UTC](https://bnd.discourse.group/t/copying-all-required-bundles-to-directory/287 "2023-01-30T11:45:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rec](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/rec/32/155_2.png) [@rec](https://bnd.discourse.group/u/rec)\
**Post date:** [January 30, 2023, 11:45am UTC](https://bnd.discourse.group/t/copying-all-required-bundles-to-directory/287/1 "2023-01-30T11:45:02Z")

</div>

I am looking for a way to copy all the bundles transitively required by a given Maven bundle module to a directory.

I found the [bnd-export-maven-plugin](https://stackoverflow.com/questions/59916285/bnd-export-maven-plugin-questions) which seems to create runnable JAR that would contain all the bundles. But I do not need a runnable JAR.

The [maven-assembly-plugin](https://maven.apache.org/plugins/maven-assembly-plugin/) won’t cut it either because I need the feature that the **bnd-resolver-maven-plugin** has which to consider bundles found in Maven’s dependency management section and not only bundles that are actual transitive dependencies when doing the resolving.

Optimally, I could tell the **bnd-resolver-maven-plugin** to resolve the requirements for a given bndrun file and copy them to a specified directory - but such a goal does not seem to exist in the **bnd-resolver-maven-plugin**.

Any ideas/pointers?

---

<div class="post-metadata">

**Author:** ![rec](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/rec/32/155_2.png) [@rec](https://bnd.discourse.group/u/rec)\
**Post date:** [January 30, 2023, 12:40pm UTC](https://bnd.discourse.group/t/copying-all-required-bundles-to-directory/287/2 "2023-01-30T12:40:48Z")

</div>

Looks like the **bnd-export-maven-plugin** does the trick. It was difficult to finds its [documentation](https://github.com/bndtools/bnd/tree/master/maven-plugins/bnd-export-maven-plugin) though. Simply searching for **bnd-export-maven-plugin** on google does not yield helpful results (for me).

```auto
<plugin>
	<groupId>biz.aQute.bnd</groupId>
	<artifactId>bnd-export-maven-plugin</artifactId>
	<version>6.4.0</version>
	<executions>
		<execution>
			<id>package</id>
			<phase>package</phase>
			<goals>
				<goal>export</goal>
			</goals>
			<configuration>
				<bndruns>
					<bndrun>src/main/osgi/package.bndrun</bndrun>
				</bndruns>
				<failOnChanges>false</failOnChanges>
				<includeDependencyManagement>true</includeDependencyManagement>
				<reportOptional>false</reportOptional>
				<scopes>
					<scope>compile</scope>
					<scope>runtime</scope>
				</scopes>
				<exporter>bnd.runbundles</exporter>
			</configuration>
		</execution>
	</executions>
</plugin>

```
