Skip to content

conditionalpackage no longer works with Blueprint since 3.4.0 #6408

@modax

Description

@modax

Hello,

I have tried to upgrade to the later bnd version in my project and I have noticed that conditionalpackage no longer works when the package in question referred only in Blueprint XML. I have not tested but I guess conditionalpackage no longer works with -plugin.

First I narrowed down the regression to version 3.4.0 and then I have git bisect'ed it to commit 7a4bc425c8d3e1c2e387c0201e18cba6a0eea435.

I attach a sample which you can use to reproduce the issue. Actually it is a modified version of maven bnd-process-conditional it test so you can easily incorporate it into source tree.

3.3.0:

mvn -q clean package -Dbnd.version=3.3.0 && \
  unzip -l target/test-bnd-process-conditional-blueprint-0.0.1-SNAPSHOT.jar | \
  grep -e com/google/common/cache/CacheBuilder.class -e com/google/common/eventbus/EventBus.class
    18643  2024-12-15 12:43   com/google/common/cache/CacheBuilder.class
     4734  2024-12-15 12:43   com/google/common/eventbus/EventBus.class

3.4.0

mvn -q clean package -Dbnd.version=3.4.0 && \
  unzip -l target/test-bnd-process-conditional-blueprint-0.0.1-SNAPSHOT.jar | \
  grep -e com/google/common/cache/CacheBuilder.class -e com/google/common/eventbus/EventBus.class

7.1.0

mvn -q clean package -Dbnd.version=7.1.0 && \
  unzip -l target/test-bnd-process-conditional-blueprint-0.0.1-SNAPSHOT.jar | \
  grep -e com/google/common/cache/CacheBuilder.class -e com/google/common/eventbus/EventBus.class

Can't confirm 100% but it is probably the case with current master branch as well.

The testcase tests both simple and factory bean but it probably only any of these is enough as it is not a root issue.

Any chance this fix could be merged to 6.x series (the last supporting Java 8) as well?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions