Bug 282851 - Default version of Ant Runtime set to Ant 1.6.5 instead of more recent 1.7.0
Default version of Ant Runtime set to Ant 1.6.5 instead of more recent 1.7.0
Status: VERIFIED FIXED
Product: Platform
Classification: Eclipse
Component: Ant
3.4.1
PC Windows XP
: P3 normal (vote)
: 3.5.1
Assigned To: Michael Rennie CLA Friend
:
: 288703 (view as bug list)
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2009-07-08 09:47 EDT by David CLA Friend
Modified: 2009-09-08 10:15 EDT (History)
6 users (show)

See Also:
Darin_Swanson: review+
darin.eclipse: review+


Attachments
proposed fix (4.20 KB, patch)
2009-08-14 11:40 EDT, Michael Rennie CLA Friend
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David CLA Friend 2009-07-08 09:47:37 EDT
Build ID: M20080911-1700

Steps To Reproduce:
1. Install multiple versions of org.apache.ant plugin as found in the Orbit project
2. Check Preferences>Ant>Runtime
3.


More information:
Seems like AntCorePreferences.getDefaultAntHomeEntries() doesn't check that the Bundle-Version is the most recent available.

We have Orbit installed and that ships with multiple versions of Ant, but the older version is getting set as the default.
Comment 1 Michael Rennie CLA Friend 2009-07-15 11:04:46 EDT
The fix for bug 275839 is the culprit here. Now that we try all providers and take the first one that provides libraries, it just so happens that we end up taking the lowest version of Ant when there is more than one version available.

One possible solution to this would be to try ad find the highest version of the provider iff all of the providers are org.apache.ant.

Darin S, any comments? 
Comment 2 Darin Wright CLA Friend 2009-07-28 14:50:07 EDT
Targetting for 3.5.1
Comment 3 Michael Rennie CLA Friend 2009-08-14 11:40:14 EDT
Created attachment 144547 [details]
proposed fix

The proposed patch examines all of the bundles that provide the org.apache.tools.ant package to do the following:

1. iff all of the providers are org.apache.ant, resolution is performed to find the highest version of Ant
2. if there exists at least one provider that is not org.apache.ant, we continue with provider resolution as we do now - i.e. we take the first provider that has libraries in the org.apache.tools.ant package.
Comment 4 Darin Wright CLA Friend 2009-08-17 13:06:30 EDT
+1. Patch looks good & tested with 3 versions of Ant. Should update copyright to 2009 before releasing.
Comment 5 Michael Rennie CLA Friend 2009-08-17 14:32:12 EDT
applied patch to HEAD and 3.5.1
Comment 6 Darin Swanson CLA Friend 2009-08-17 16:21:11 EDT
Looks good.
Comment 7 Michael Rennie CLA Friend 2009-08-17 16:39:16 EDT
marking verified
Comment 8 Michael Rennie CLA Friend 2009-09-08 10:06:57 EDT
*** Bug 288703 has been marked as a duplicate of this bug. ***