Eclipse does not download latest jar of the same version from the target platform

南笙酒味 提交于 2019-12-05 10:48:59

Eclipse (well p2 actually) uses the ID + Version as the unique identifier for a bundle. This is stored in caches and sometimes even shared between instances. If you change the content of a jar, even slightly, you MUST Change the version number. You'll notice that Eclipse uses version numbers such as x.y.z.qualifier where qualifier is a timetstamp (20120928-2359).

The MD5s that p2 has are only for checking validity of the download.

I'm sorry, but this is the way it is. Luckily, both Tycho and PDE/Build can handle .qualifier and change them into a meaningful date for you.

I came across a similar problem and my Google Search led me to this page.

I figured I'd put in my answer here, in case it helps others.

Please Note (and as others have mentioned): This is not normal behavior to have the same numbered JAR if it is indeed different. I came across this because I had a "test" repository to make sure I could download a custom plugin from the repo, and I updated with the same version number, since once it becomes "official" in my company, that will be the version number it will use.

Long story short, I uninstalled my plugin through eclipse, removed the folder containing the plugin in my plugins directory, took the jar from the remote repo, and extracted it into my plugins directory, went back into Eclipse and installed my plugin.

Again, note that this is not the intended way to do this, and should be treated as a last-resort hack, since I don't know what other internal Eclipse assumptions this may break. I haven't seen any personally, but YMMV. If I come across any issues, I will update this answer.

I know this question is quite old, but perhaps I can give an insight into this problem.

Eclipse does not really share bundle pools between workspaces. Instead, all known workspaces are taken into account when resolving the target platform. These "known workspaces" simply are the ones in your "Recent workspaces" list. So, during resolution of a target platform in workspace A, Eclipse looks for needed bundles in the bundle pools of other workspaces and simply copies those already downloaded bundles from there to the bundle pool of workspace A, instead of really downloading the most recent bundle file from the P2 repositories configured in your target platform for workspace A.

The root of all evil is, of course, what irbull has already explained.

As a workaround, you can simply remove all other workspaces from the list of "Recent workspaces", close Eclipse, delete the bundle pool of the workspace you want to update, start Eclipse and initiate a resolution of the target platform of your choice. Eclipse will then really download all the bundles from the appropriate locations.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!