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

Bug 338835

Summary: New shared license feature corrupts feature.xml
Product: [Eclipse Project] PDE Reporter: Greg Watson <g.watson>
Component: BuildAssignee: pde-build-inbox <pde-build-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aniefer, dean.t.roberts, gunnar, kim.moir, kpqb38
Version: 3.7   
Target Milestone: 3.7 M7   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Feature before mangling none

Description Greg Watson CLA 2011-03-03 12:10:18 EST
I'm trying to use the new shared license feature. I've created a new feature that contains the license files and a feature.xml as follows:

<?xml version="1.0" encoding="UTF-8"?>
<feature
      id="org.eclipse.ptp.license"
      version="1.0.0.qualifier"
      image="eclipse_update_120.jpg">

   <description>
      %description
   </description>

   <copyright>
      %copyright
   </copyright>

   <license url="%licenseURL">
      %license
   </license>

</feature>

I have removed the license files from the original feature and modified the feature.xml as follows:

<?xml version="1.0" encoding="UTF-8"?>
<feature
      id="org.eclipse.ptp"
      label="%featureName"
      version="5.0.0.qualifier"
      provider-name="%providerName"
      plugin="org.eclipse.ptp"
      license-feature="org.eclipse.ptp.license"
      license-feature-version="1.0.0.qualifier">

   <description url="http://eclipse.org/ptp">
      %description
   </description>
...

I'm using v20110223 of org.eclipse.releng.basebuilder. The build completes successfully and the license files appear to have been copied into the feature. However the feature.xml appears to be corrupted:

 url="%licenseURL">      %license
  <?xml version="1.0" encoding="UTF-8"?>
<feature
      id="org.eclipse.ptp"
      label="%featureName"
      version="5.0.0.201103031008"
      provider-name="%providerName"
      plugin="org.eclipse.ptp"
      
      >

   <description url="http://eclipse.org/ptp">
      %description
   </description>
...
Comment 1 DJ Houghton CLA 2011-03-03 13:45:24 EST
Adding Dean to the CC.
Comment 2 Andrew Niefer CLA 2011-03-03 13:47:42 EST
I have to assume something is going wrong in the LicenseReplaceTask, Greg can you please attach a copy of your modified feature.xml before the build mangles it.
Comment 3 Greg Watson CLA 2011-03-03 14:29:42 EST
Created attachment 190303 [details]
Feature before mangling
Comment 4 Andrew Niefer CLA 2011-03-03 17:04:30 EST
Greg, you can add back the 
   <license url="%licenseURL">
      %license
   </license>
section to your feature.xml and things should work better.

The code is trying to update this section with content based on the license feature, but it isn't doing a very good job when that section doesn't exist.
Comment 5 Greg Watson CLA 2011-03-03 20:53:51 EST
That's fixed it, thanks.
Comment 6 Andrew Niefer CLA 2011-03-16 15:51:56 EDT
*** Bug 338958 has been marked as a duplicate of this bug. ***
Comment 7 Andrew Niefer CLA 2011-03-24 16:43:52 EDT
fixed
Comment 8 Gunnar Wagenknecht CLA 2011-04-14 05:34:30 EDT
*** Bug 342750 has been marked as a duplicate of this bug. ***