Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 395773

Summary: [0.17.0-SNAPSHOT] tycho-source-feature-plugin fails complaining about licenseURL
Product: z_Archived Reporter: Paul Webster <pwebster>
Component: TychoAssignee: Jan Sievers <jan.sievers>
Status: RESOLVED FIXED QA Contact:
Severity: blocker    
Priority: P3 CC: jan.sievers, mistria, t-oberlies, thanh.ha
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=374349
Whiteboard:
Bug Depends on:    
Bug Blocks: 372792, 393922    

Description Paul Webster CLA 2012-12-04 20:06:02 EST
We've picked up the fix from bug 374349 but now our build fails with:

[ERROR] Failed to execute goal org.eclipse.tycho.extras:tycho-source-feature-plugin:0.17.0-SNAPSHOT:source-feature (source-feature) on project org.eclipse.e4.rcp: Source feature depends on 'sourceTemplateFeature/feature.properties', entry 'licenseURL'. However, this key could not be found -> [Help 1]

licenseURL comes from the licence feature support AFAIK, not from the feature.properties, and the main feature builds correctly, consuming the license feature.

PW
Comment 1 Mickael Istria CLA 2012-12-05 01:27:25 EST
Can you please provide a small dummy project that reproduce the issue?
Comment 2 Jan Sievers CLA 2012-12-05 03:17:55 EST
can you provide 

1) links to a sample project with steps to reproduce
2) docs on how PDE license feature support in PDE headless build, esp. how internationalized licenseURL  values (using %key syntax) are resolved.
Comment 3 Jan Sievers CLA 2012-12-05 03:24:27 EST
as a side note: as long as CBI build uses latest tycho SNAPSHOT, you will encounter "bumps in the road" like this one as we are developing tycho.
Comment 4 Paul Webster CLA 2012-12-05 10:28:05 EST
(In reply to comment #2)
> can you provide 
> 
> 1) links to a sample project with steps to reproduce


http://git.eclipse.org/c/e4/org.eclipse.e4.ui.git/tree/examples/tycho/license-feature-example

This is a self contained example, and can be built with mvn clean install.

When the tycho versions are set to 0.16.0 it builds the feature + source feature, and includes the licenseURL

With tycho versions of 0.17.0-SNAPSHOT it fails with 
[ERROR] Failed to execute goal org.eclipse.tycho.extras:tycho-source-feature-plugin:0.17.0-SNAPSHOT:source-feature (source-feature) on project org.eclipse.hello.feature: Source feature depends on 'sourceTemplateFeature/feature.properties', entry 'licenseURL'. However, this key could not be found -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.tycho.extras:tycho-source-feature-plugin:0.17.0-SNAPSHOT:source-feature (source-feature) on project org.eclipse.hello.feature: Source feature depends on 'sourceTemplateFeature/feature.properties', entry 'licenseURL'. However, this key could not be found

...
Comment 5 Paul Webster CLA 2012-12-05 10:30:19 EST
It looks like 0.16 supports generating the licenseURL and license text from the org.eclipse.license feature into the built feature and not into the source.

Now that the source feature is using property keys in the 0.17 snapshot, the source feature needs the license feature generation applied to it as well.

PW
Comment 6 Jan Sievers CLA 2012-12-05 16:25:42 EST
this is the relevant tycho commit that introduced license feature support:

http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/commit/?id=d9e8dc7cde6cab7f6b5939df1354de537aba6483

and these are some docs ("proposed solution" does not say if that solution was actually implemented though):
http://wiki.eclipse.org/Equinox/p2/License_Mechanism


it seems that the implementation in tycho merges feature.properties entries from license feature and payload feature into payload with payload taking precedence.
Comment 7 Jan Sievers CLA 2012-12-06 09:05:48 EST
I am working on a patch that merges the effective source feature properties from two sources:

1. _generated_ original feature.properties (i.e. in case the feature has a license feature, this is already merged content from license and payload feature)
2. sourceTemplateFeature/feature.properties

content from 2. has precedence over content from 1.
Comment 8 Jan Sievers CLA 2012-12-07 08:01:02 EST
https://git.eclipse.org/r/#/c/9093/
Comment 9 Jan Sievers CLA 2012-12-07 09:18:48 EST
http://git.eclipse.org/c/tycho/org.eclipse.tycho.extras.git/commit/?id=69063917295461fa2a2cd8ee1a7461e8fb5aaa61

this fixes the problem demonstrated by the sample project

@Paul, Thanh

can you try to run a CBI build with -U (force snapshot updates) and tell me if the problem is gone with this change?
Comment 10 Jan Sievers CLA 2012-12-07 11:36:30 EST
added IT
https://git.eclipse.org/r/#/c/9106/
Comment 11 Thanh Ha CLA 2012-12-07 19:27:37 EST
(In reply to comment #9)
> http://git.eclipse.org/c/tycho/org.eclipse.tycho.extras.git/commit/
> ?id=69063917295461fa2a2cd8ee1a7461e8fb5aaa61
> 
> this fixes the problem demonstrated by the sample project
> 
> @Paul, Thanh
> 
> can you try to run a CBI build with -U (force snapshot updates) and tell me
> if the problem is gone with this change?

I was able to build with this fix. I'm no longer seeing the licenseURL issue anymore.