# How to concatenate multiple @Header into a single manifest header?

**URL:** <https://bnd.discourse.group/t/how-to-concatenate-multiple-header-into-a-single-manifest-header/80>\
**Category:** GENERAL\
**Created:** [January 21, 2021, 3:52pm UTC](https://bnd.discourse.group/t/how-to-concatenate-multiple-header-into-a-single-manifest-header/80 "2021-01-21T15:52:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisr3](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/chrisr3/32/58_2.png) [@chrisr3](https://bnd.discourse.group/u/chrisr3)\
**Post date:** [January 21, 2021, 3:52pm UTC](https://bnd.discourse.group/t/how-to-concatenate-multiple-header-into-a-single-manifest-header/80/1 "2021-01-21T15:52:21Z")

</div>

Hi,

Suppose my bundle contains two classes/packages, one of which is annotated with

```auto
@Header(name = "MyTag", value = "foo")

```

and the other with:

```auto
@Header(name = "MyTag", value = "bar")

```

I have noticed that one of these `@Header` annotations will effectively clobber the other, and it’s not difficult to understand why. Nor is it currently causing me a problem. However, I can imagine a time when I might want my bundle’s final `MANIFEST.MF` to contain this instead:

```auto
MyTag: bar,foo

```

Does Bnd already support some form of “duplicates resolution” policy for manifest headers, please? Or does something make it unnecessary?

Note that my bundle currently contains multiple occurrences of just:

```auto
Header(name = "MyTag", value = "foo")

```

and that I _do_ want its manifest ultimately to contain only:

```auto
MyTag: foo

```

which is indeed the current behaviour.

Thanks,  
Chris

---

<div class="post-metadata">

**Author:** ![bjhargrave](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/bjhargrave/32/10_2.png) [@bjhargrave](https://bnd.discourse.group/u/bjhargrave)\
**Post date:** [January 21, 2021, 5:53pm UTC](https://bnd.discourse.group/t/how-to-concatenate-multiple-header-into-a-single-manifest-header/80/2 "2021-01-21T17:53:33Z")

</div>

I don’t believe there is any support for combining or deduplicating header values. You just need to be careful.

I have only used it for things such as `@Header(name = Constants.BUNDLE_ACTIVATOR, value = "${@class}")` and you shouldn’t have multiple bundle activator classes in one bundle.

---

<div class="post-metadata">

**Author:** ![chrisr3](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/chrisr3/32/58_2.png) [@chrisr3](https://bnd.discourse.group/u/chrisr3)\
**Post date:** [January 21, 2021, 5:59pm UTC](https://bnd.discourse.group/t/how-to-concatenate-multiple-header-into-a-single-manifest-header/80/3 "2021-01-21T17:59:34Z")

</div>

Thanks for replying. As I said, it’s not currently causing me any grief. But I suspect my use-case is more grotesque than yours… 🙀.

Cheers,  
Chris
