Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362781 - p2.inf under non-product projects are not taken into account in tycho build
Summary: p2.inf under non-product projects are not taken into account in tycho build
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-03 07:46 EDT by Emac CLA
Modified: 2021-04-28 16:55 EDT (History)
4 users (show)

See Also:


Attachments
sample feature project (93.27 KB, application/octet-stream)
2011-11-03 07:47 EDT, Emac CLA
no flags Details
content.xml generated by tycho (5.94 KB, text/xml)
2011-11-03 07:47 EDT, Emac CLA
no flags Details
content.xml generated by export wizard in eclipse (7.30 KB, text/xml)
2011-11-03 07:48 EDT, Emac CLA
no flags Details
The correct source project of the sample feature (2.15 KB, application/octet-stream)
2011-11-08 10:52 EST, Emac CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Emac CLA 2011-11-03 07:46:01 EDT
Build Identifier: 

As specified in http://wiki.eclipse.org/Equinox/p2/Customizing_Metadata#Advice_file_format, besides the same folder as .product (for products), the touchpoint instructions (p2.inf) can also appear and be respected under the same folder as feature.xml (for features), META-INF/ (for bundles).

But up to now tycho only supports the product scenario. If a feature owns a p2.inf, the instructions won't be covered in the generated P2 metadata (content.jar) in case it's built by tycho. While if it's exported by wizard, it does.

Attachments:
1. a sample feature project which contains a valid p2.inf, as well as pom.xml
2. the content.xml generated by tycho, which is incorrect.
3. the content.xml generated by export wizard, which is correct.

Reproducible: Always

Steps to Reproduce:
1.Import attached feature project into eclipse. Under root folder, there's a p2.inf which invokes "setProgramProperty" action in install phase.
2.Export the feature by wizard and check the content.xml which includes the instruction.
3.Build the project by maven and check the content.xml which doesn't include the instruction.
Comment 1 Emac CLA 2011-11-03 07:47:17 EDT
Created attachment 206398 [details]
sample feature project
Comment 2 Emac CLA 2011-11-03 07:47:48 EDT
Created attachment 206399 [details]
content.xml generated by tycho
Comment 3 Emac CLA 2011-11-03 07:48:14 EDT
Created attachment 206400 [details]
content.xml generated by export wizard in eclipse
Comment 4 Igor Fedorenko CLA 2011-11-05 17:04:51 EDT
fwiw, p2.inf works as expected for eclipse-plugin project, we use it for m2e for quite some time now. See [1] for example


http://git.eclipse.org/c/m2e/m2e-core.git/tree/org.eclipse.m2e.usagedata/META-INF?id=milestones/1.0.100/1.0.100.20110804-1717
Comment 5 Tobias Oberlies CLA 2011-11-08 08:39:38 EST
Sorry, but I cannot reproduce the problem. The attachment from comment 1 doesn't contain a project but a p2 repository.

My understanding was also that p2.inf files work in eclipse-feature projects, so please reopen this bug if you can reproduce the problem. BTW, you don't say which Tycho version you were using.
Comment 6 Emac CLA 2011-11-08 10:52:40 EST
Created attachment 206608 [details]
The correct source project of the sample feature

Please ignore the previous one (attachment#1 [details]).
Comment 7 Emac CLA 2011-11-08 10:54:03 EST
Reopen this issue since I can always re-produce it. I'm using version 0.13.0 of tycho.
Comment 8 Emac CLA 2011-11-08 11:27:51 EST
And yes, the p2.inf inside a plugin is considered when exported with a feature. But still the p2.inf inside a feature is not.
Comment 9 Sebastien Angers CLA 2011-12-12 22:15:03 EST
Bonsoir,

We are also facing that issue where p2.inf files under Features are not honored by Tycho.

Works fine under a Bundle and under a Product (if using the Product ID prefix as noted on https://issues.sonatype.org/browse/TYCHO-517), but does not work for Features.

Any suggestion?

Thanks!
Comment 10 Igor Fedorenko CLA 2011-12-13 00:04:34 EST
The attached example file does not include p2.inf in the feature.jar file in build.properties. Using Tycho 0.14.0-SNAPSHOT, the touchpoint instructions are properly included in generated p2 metadata after I fixed build.properties file.

0.13.0 indeed did not include setProgramProperty instructions in p2 repository metadata.
Comment 11 Sebastien Angers CLA 2011-12-13 13:37:47 EST
Bonjour,

I confirm p2.inf files under Features are honored by latest Tycho 0.14.0

Note that to make it work, had to ensure p2.inf was added to bin.includes of Feature's build.properties; which is not required in PDE Build.  Might be good to document.

Thanks Igor for the update!
Comment 12 Tobias Oberlies CLA 2011-12-14 03:58:48 EST
(In reply to comment #11)
> Note that to make it work, had to ensure p2.inf was added to bin.includes of
> Feature's build.properties; which is not required in PDE Build.  Might be good
> to document.
But this is not right. You shouldn't include the p2.inf in your binaries. Are you by any chance still using eclipse-update-site?
Comment 13 Igor Fedorenko CLA 2011-12-14 06:28:37 EST
(In reply to comment #12)
> (In reply to comment #11)
> > Note that to make it work, had to ensure p2.inf was added to bin.includes of
> > Feature's build.properties; which is not required in PDE Build.  Might be good
> > to document.
> But this is not right. You shouldn't include the p2.inf in your binaries. Are
> you by any chance still using eclipse-update-site?

Currently Tycho requires p2.inf to be packaged into the final artifact. This is side-effect of the way "full" metadata currently gets published (see my https://bugs.eclipse.org/bugs/show_bug.cgi?id=366456#c3). I have not decided if this is desired or not yet.