# Only including certain files in bundle

**URL:** <https://bnd.discourse.group/t/only-including-certain-files-in-bundle/282>\
**Category:** GENERAL\
**Created:** [December 22, 2022, 3:15pm UTC](https://bnd.discourse.group/t/only-including-certain-files-in-bundle/282 "2022-12-22T15:15:59Z")\
**Posts on this page:** 3\
**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:** [December 22, 2022, 3:15pm UTC](https://bnd.discourse.group/t/only-including-certain-files-in-bundle/282/1 "2022-12-22T15:15:59Z")

</div>

I have a project which configures the maven-jar-plugin to only include certain files in to the final JAR:

```auto
<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-jar-plugin</artifactId>
	<configuration>
		<includes>
			<include>**/*.csv</include>
			<include>...</include>
		</includes>
	</configuration>
</plugin>

```

Now, I want to turn that Maven module into a bundle using the maven-bnd-plugin. However, the `jar` goal of the plugin does not seem to support includes/excludes and it also seems to replace the execution of the `maven-jar-plugin` so that the configuration has no effect anymore.

Specifically, I have some `*.class` files that should **not** end up in the bundle - it should be a pure data bundle (actually a fragment).

Is there any way to achieve only including certain patterns of files with the maven-bnd-plugin?

---

<div class="post-metadata">

**Author:** ![rotty3000](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/rotty3000/32/16_2.png) [@rotty3000](https://bnd.discourse.group/u/rotty3000)\
**Post date:** [December 22, 2022, 3:45pm UTC](https://bnd.discourse.group/t/only-including-certain-files-in-bundle/282/2 "2022-12-22T15:45:43Z")

</div>

Seems you enabled bnd-maven-plugin to take over packaging, but you don’t have to!!! Just don’t enable the extension mode of the plugin and use the `bnd-process` mojo, then jar-ing will continue to be handle by the maven-jar-plugin.

---

<div class="post-metadata">

**Author:** ![rotty3000](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/rotty3000/32/16_2.png) [@rotty3000](https://bnd.discourse.group/u/rotty3000)\
**Post date:** [December 22, 2022, 3:47pm UTC](https://bnd.discourse.group/t/only-including-certain-files-in-bundle/282/3 "2022-12-22T15:47:28Z")

</div>

See the different mojos documented here [bnd/README.md at master · bndtools/bnd · GitHub](https://github.com/bndtools/bnd/blob/master/maven-plugins/bnd-maven-plugin/README.md#bnd-process-goal)
