[INFRAUTILS-28] inter-project dependencies are not expressed correctly in feature definitions Created: 13/Feb/18  Updated: 19/Feb/18  Resolved: 19/Feb/18

Status: Resolved
Project: infrautils
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: Faseela K Assignee: Faseela K
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

As per

https://lists.opendaylight.org/pipermail/release/2018-January/013604.html

https://lists.opendaylight.org/pipermail/release/2017-September/012356.html

infrautils  inter-project dependencies are not expressed correctly in feature definitions, as downstream projects are packaging their ODL upstream's bundles directly in their features, rather than properly depending on upstream's features.

infrautils/odl-infrautils-ready/1.3.0-SNAPSHOT/odl-infrautils-ready-1.3.0-SNAPSHOT-features.xml: <bundle>wrap:mvn:org.opendaylight.odlparent/bundles-test-lib/3.0.2</bundle>

Please read the above mails to get full understanding of the issue, and please fix the same in your project



 Comments   
Comment by Michael Vorburger [ 15/Feb/18 ]

re-assigning from default assignee to k.faseela who already started looking into this... copy/paste of private email exchange:

On Thu, Feb 15, 2018 at 12:07 PM, Faseela K <faseela.k@ericsson.com> wrote:
Hi,

I was trying to correct infrautils ready’s feature pom, based on Robert’s mail.

The generated feature.xml shows : <bundle>wrap:mvn:org.opendaylight.odlparent/bundles-test-lib/3.0.2</bundle>
However I do not see any bundle dependency in the respective pom, only odlparent feature is there.

How will that happen?

With reply:

ready/impl/pom.xml has the dependency to bundles-test-lib you are looking for.

but that POM has the maven-bundle-plugin configuration instructions for BND to <Embed-Dependency> bundles-test-lib (and awaitility & hamcrest-core...), so I'm surprised that the generated feature.xml shows <bundle>wrap:mvn:bundles-test-lib ... it should not, we do not need that - because bundles-test-lib is embedded in ready-impl-1.3.0-SNAPSHOT.jar (it is; I just double checked, just to be sure).

It's funny BTW that in common/features/odl-infrautils-ready/target/feature/feature.xml this problem only affects bundles-test-lib, but not awaitility & hamcrest-core... but that's just a lucky coincence (I suspect because the latter 2 are <scope>test in odlparent, overridden to be scope compile in ready/impl, but that does not affect odl-infrautils-ready).

So the real problem here, and possibly elsewhere as well , is that the automatic feature generation apparently adds bundle wrap to features for dependencies which are embedded. And I kind of see why... it cannot really know (at the time it generates the feature) that some of dependencies were embedded (in another POM). Some proposed ideas to address this, in the order I would try them:

1. Perhaps playing with the <scope> of such dependencies, say provided instead of runtime for bundles-test-lib in ready/impl/pom.xml, can convince the feature generation to ignore them? Just make sure that the embedding then actually still works with that... Worth a try... do you want to try that, first?

2. Otherwise, try adding an <exclusions> to the ready-impl <dependency> of common/features/odl-infrautils-ready/pom.xml for bundles-test-lib. This is more likely to work I expect - but it's a bit uglier than 1. because we would duplicate this in two POM.

I expect this problem may affect other features in ODL which depend on bundles which use embedding; I know e.g. in AAA there are some - and think it would be worthwhile to share this more widely - perhaps best after the solution?

Comment by Faseela K [ 17/Feb/18 ]

https://git.opendaylight.org/gerrit/#/c/68376/

Comment by Michael Vorburger [ 19/Feb/18 ]

merged - thanks k.faseela!

Generated at Wed Feb 07 20:02:04 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.