Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347775 - FeatureRootAdvice implicitly assumes feature id == POM artifactId
Summary: FeatureRootAdvice implicitly assumes feature id == POM artifactId
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Tobias Oberlies CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 353384
Blocks:
  Show dependency tree
 
Reported: 2011-05-31 08:57 EDT by Jan Sievers CLA
Modified: 2021-04-28 16:55 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Sievers CLA 2011-05-31 08:57:23 EDT
the omplementation of FeatureRootAdvice#isApplicable() implicitly relies on feature ID from feature.xml == maven POM artifactId. However tycho does not enforce this.

Probably we should not rely on equality here but rather use a mapping. We should have the mapping info since we also create MavenPropertiesAdvice which contains the IU -> GAV coordinates mapping.
Comment 1 Igor Fedorenko CLA 2011-05-31 11:29:32 EDT
Beware that tycho-versions-plugin assumes Maven artifactId to match Eclipse project id. Not sure if there are other places that make the same assumption, but I wonder if there is a real need to allow such flexibility.
Comment 2 Jan Sievers CLA 2011-05-31 12:55:10 EDT
(In reply to comment #1)
> Beware that tycho-versions-plugin assumes Maven artifactId to match Eclipse
> project id. Not sure if there are other places that make the same assumption,
> but I wonder if there is a real need to allow such flexibility.

so we need to decide whether we require  Maven artifactId == OSGI artifact id or not.
If we require it, we should make it explicit and validate it.
Comment 3 Igor Fedorenko CLA 2011-05-31 15:38:24 EDT
(In reply to comment #2)
> If we require it, we should make it explicit and validate it.

I am +1 on adding and validating this requirement. Too much flexibility can be a problem too.
Comment 4 Jan Sievers CLA 2011-06-01 06:42:21 EDT
(In reply to comment #3)
> I am +1 on adding and validating this requirement. Too much flexibility can be
> a problem too.

I agree. While thinking about it again I just see one potential problem:
I guess there are many existing eclipse projects with the same ID for a plugin and a feature.
If we validate Maven artifactId == OSGI artifact id, then they have to either

1. use different maven groupIds for feature and plugin

- or -

2. change feature or plugin ID (which in general is an incompatible change)
Comment 5 Tobias Oberlies CLA 2011-06-10 12:27:31 EDT
I agree that it is good practice to have matching artifactIds, but I don't think that we should force an incompatible change on our users. Therefore I think we will need to allow artifactId != Eclipse ID.

The only option I see is to enforce artifactId == p2 ID. The p2 IDs anyway need to be unique. Not sure people will like the "org.example.feature.feature.group" IDs for eclipse-feature modules though...
Comment 6 Igor Fedorenko CLA 2011-06-14 15:31:48 EDT
Just a thought -- Tycho does not have to support every single possible use case and usage scenario. There are always going to be cases Tycho does not or cannot support.
Comment 7 Tobias Oberlies CLA 2011-07-29 04:51:46 EDT
I am now also in favour of enforcing artifactId == Eclipse ID. With the option to have different groupIds (e.g. abc and abc.features), there is still enough flexibility for people who need to keep IDs for compatibility reasons.

I've created bug 353384 for the proposed change. This would solve this issue.
Comment 8 Tobias Oberlies CLA 2011-08-22 10:14:32 EDT
With bug 353384 implemented, the assumption feature ID == artifactId is valid. Therefore the problem of missing root files can no longer occur.