title: how can I find the correspondence between org.eclipse.jdt.core and eclipse releases? - eclipse

I am new to eclipse. Where can I find the org.eclipse.jdt.core version (e.g., [3.10.0,4.0.0) bundled with each official eclipse release. it would be tedious to find out by installing each eclipse version

I don't know of a versions list. You can download just the 'JDT Runtime Binary' for the various releases from the Eclipse Projects Archives. This is about 27Mb per release. This is just a zip file, you don't need to install it, just examine the contents.

I would recommend a tool like p2-browser. It will allow you to examine the contents of Eclipse P2 Update sites by just downloading the meta data.
Using p2browser
Once you have started p2browser (see below), you should have a screen like this:
Add 1 or more p2 sites to consider and allow the tool to download the metadata.
Press Add
Put the p2 site (e.g. for Mars: http://download.eclipse.org/releases/mars)
Press OK and wait for download
Repeat until you have all the versions you are interested in.
You should now have your added p2 sites listed in the tree viewer:
Now you can add your plug-in or feature you are interested in, e.g. in your case org.eclipse.jdt.core in the filter box:
Another example of what you can filter on, e.g. org.eclipse.jdt.feature.group for the JDT Feature
Download/Install/Build
Java Web Start
To use the p2 browser you may like to simply use Java Web Start, Run:
javaws http://ifedorenko.github.com/p2-browser/javaws/com.ifedorenko.p2browser.jnlp
Or click this link, as docs show, results for using java web start may vary because of tightening security considerations of running arbitrary java downloaded from the web.
Build and Run with Maven
You can build it with maven, as per the docs. These are simplified instructions:
git clone git#github.com:ifedorenko/p2-browser.git
cd p2-browser/
mvn clean package
cd com.ifedorenko.p2browser.rcp/target/products/com.ifedorenko.p2browser.rcp
Linux x64: linux/gtk/x86_64, other platforms, choose the correct directory.
./p2browser

Related

Repackage update site into one feature

I have an update site that contains some 100 - 200 features and many more plugins. For some users all of these are needed, so I'd like to simplify the installation process by creating one feature that they can install. This feature would then contain all the contents of the update site.
I've created a new feature project and my plan is to add the contents of the original update site as included features and plugins in this project.
Problems is; In my feature project, when adding feature in the "included features" tab, I can only add features that are currently installed in my Eclipse platform. I'd rather not install those 200 features just so I can add them.
Is there a way to work around this?
Without the features installed in your target platform, you will need to edit the feature.xml file directly. All you need to do is to add the following for each feature that you want to include:
<includes
id="<add_feature_id>"
version="0.0.0"/>
Your build process (PDE or tycho) should add the proper version numbers for you.
I think you should have a detailed look at the Eclipse target platform concept. The features don't need to be installed in your current Eclipse platform (i.e. the IDE), they need to be installed in the target platform to be available for an update site.
If you never defined a target platform, your currently running application will be taken as IDE, and that is where your confusion might come from.
When I try to manipulate a feature I only need to have them in my workspace. No reason to install them.

Tycho and Eclipse: How to resolve OSGI dependencies to my own bundles at development time within Eclipse, without opening all of them in the IDE

Background
My Eclipse RCP application is built using Tycho. It consists of multiple components (in the form of OSGi bundles/Eclipse plug-ins). One of these component contains the product file and materializes the product.
There is a reactor POM at the application root, which builds all components in order, but I also want to build other components independently (using mvn deploy) .
Building such a single component works as follows:
Retrieve the latest versions of all the component's dependencies from our company (p2) repository.
Build the component.
Deploy the component to our company repository to be used as a dependency for other components itself.
Note: Our repository is a normal maven2 repository hosted on a Nexus, whose RCP artifacts are automatically mapped to a p2 repository format as well. This way, Tycho can use the p2 repository format to find dependencies, while the standard Maven deployment can be used. This works fine.
Note: My parent POM makes sure that we look for dependencies at the p2 repository URL. The deployment URL is the default maven2 format location of the repository. This works fine.
Problem
When building such a single component through the command-line (mvn deploy), Maven looks for intra-project dependencies in the p2 repository and they are correctly resolved (i.e. latest version is automatically downloaded and used in build).
However, when developing in Eclipse, the IDE cannot resolve them. The manifest files gives an error at each of my intra-project dependencies that they cannot be resolved.
Question
My question is: How can I make the Eclipse IDE look for dependencies (and new versions of dependencies) in either:
My local p2 repository (~/.m2/repository/p2/osgi/bundles)
My company p2 repository (nexus.mycompany.com/myproduct-snapshots/.meta/p2)
Ideally, it would look for them every time and fetch the latest version if a newer version is available.
If it does not use the p2 repository URLs in the POM, how should I configure Eclipse?
Example
Consider an eclipse plug-in com.mycompany.myproduct.fancy, which depends on another eclipse plug-in com.mycompany.myproduct.core.
Both also have a POM (configured for Tycho use), which (through their parent POM) have my Nexus repositories configured correctly: maven2 repository URL for deployment and p2 repository URL to look for dependencies.
First I deploy the core plug-in to my maven repository (using the default mvn deploy). The Nexus repository will provide this deployed plug-in in both maven and p2 format.
When I build the fancy component through the command line (using mvn install), the (earlier deployed) core component is found and downloaded automatically.
project/com.mycompany.myproduct.fancy$ mvn clean install
<searches in p2 repository, download core>
<builds fancy>
<SUCCESS>
When I open a new Eclipse workspace and open the fancy component, its Manifest (which contains its dependencies) gives the following error:
Bundle 'com.mycompany.myproduct.core' cannot be resolved.
My question is: how can I develop the fancy component in the Eclipse IDE without the need to open core as project in Eclipse.
Speculation
This is some speculation from my side. Please correct me if I'm wrong and any other solution to the actual problem is also welcome!
I know the m2e plug-in of the Eclipse IDE currently maps Maven POMs to Eclipse concepts (using m2e connectors). I have installed the dedicated Tycho connectors. For example, the mvn compile step is actually performed by the Eclipse JDT compiler.
I also know that when a complete Tycho product is started in Eclipse, it is run in the Eclipse PDE environment. For example, I need to a specify a target platform in my Run configuration.
I know I can open all components in my Eclipse workspace. This would solve the problem, but is not feasible as I have many components and this would break independent component development.
I assume the Eclipse m2e mapping and/or the PDE build environment is not smart enough to fetch (latest) dependencies automatically at build time. Please correct me if I'm wrong. :)
Therefore, I assume I need to specify the target platform at build time too. I have taken a look at Window > Preferences > Plug-in Development > Target Platform. I can add our p2 repository to the Target Platform, which solves the problem. However this gives many problems:
I need a feature containing all components for this to work. Only features can be added.
Every time I deploy a new build of a single component, I would have to rebuild the complete feature (to create a new feature version on our p2 repository).
Every time I update a component and build the feature, I would have to manually change the Target Platform.
If the above is all correct, I speculate I need an m2e connector (or a different one from the current one) that actually checks the p2 repositories specified in the POM when resolving the OSGi dependencies and automatically adds those to the target platform.
As indicated by Nick Wilson, you will need to install the m2e Tycho Configurator, which basically "links up" Eclipse and Tycho (i.e., makes Tycho available in Eclipse).
You should've been pointed towards it after having installed m2e, but you can also install it manually:
Go to Window > Preferences > Maven > Discovery.
Click the "Open Catalog" button. This will open the "m2e Marketplace" window.
Search for "tycho", this should give you the "Tycho Configurator" as sole search result.
Click "Finish", you're done.
I've had this issue as well, and it isn't simple to find the solution, so I hope this helps!
The "most automated" way to configure your target platform in Eclipse is to use a target file. That file can be checked in with your sources, so every developer only needs to open the file and click on "Set as Target Platform" to activate it. AFAIK there is no m2e connector or Eclipse plug-in which does that automatically.
Given your development process, setting up this target file is a little more tricky. Since you don't have a feature which contains the latest version of all your bundles, you need to include the bundles directly in the target file. This is not possible via the rich editor, but can be done with a text editor:
Create a target definition file, add your p2 repository, and select any feature from that p2 repository. Save the file.
Open the target file in a text editor, remove the <unit> entry for the feature you added.
Instead, add an entry for each of your bundles:
<unit id="a.bundle.symbolic.name" version="0.0.0"/>
This target file then contains the latest version of each of the listed bundles. To see the content, open the file with the "Target Editor" again and switch to the "Content" tab. This file can now be used by all developers.
Note: When a new version of one of the bundles is deployed to Nexus, the developers will only see that new version if they open the target file and choose "Set as Target Platform" again.

Eclipse RCP: build product able to load all plugins in plugins directory

I need to configure my eclipse product to load all features/plugins in features/plugins directory. Now my product loads just plugins that are listed in metadata, so if I export some plugin directly from eclipse tool as "deployable plugins" it's loaded in my product, but if I put a plugin jar directly in plugins directory It doesn't appear (the same if I work with features)
I simply make new product configurations, put the feature that contains my application plugin and then exporting product I have this problem.
My eclipse version is 3.6.1
I think the problem is in the launcher configuration but I don't know what I have to change
In theory, your exported RCP application should simply pick up any new features and plugins you add later. However, make sure you put the extra stuff in the dropins folder of your RCP, since this is the expected location for manually installed features since the introduction of p2.
If for some reason it still doesn't work, try launching Eclipse with the -clean command line argument.
According to The Eclipse runtime options page, the -clean argument has the following effect:
[...] any cached data used by the OSGi framework and eclipse runtime will be wiped clean. This will clean the caches used to store bundle dependency resolution and eclipse extension registry data. Using this option will force eclipse to reinitialize these caches.
In my experience this can resolve many mysterious cases, where newly added plugins are not loaded by Equinox.

Programatically installing an Eclipse plugin from within Eclipse?

I want to create an automated installer for an Eclipse plugin (i.e. not through the "Update Manager"). My scenario is simple: the user closes Eclipse, drops a downloaded JAR into the dropins folder, starts Eclipse and the rest of the process is automated.
In older Eclipse versions, before the era of P2, Eclipse had (still has) a class called InstallCommand which could be used to install pluings into the currently running platform.
While this still works in Eclipse 3.4 & 3.5, it is not behaving properly: most noticeably, plugins installed that way cannot be automatically uninstalled (it is dimmed).
The JavaDoc claims the InstallCommand is deprecated and should be replaced by a P2 alternative. However, I couldn't find the right tool for the job. There is the P2 director, but it is built for running as a separate application from the command line. It is possible to invoke it from within Eclipse but it is really not cut out for that. For example, progress monitoring and error reporting are not working well.
Does anybody know of a good alternative for that?
Thanks,
Zviki
Dropins seems very close to what you want, especially if they are just downloading jars without the associated metadata (ie the metadata will need to be auto-generated).
You could consider defining a second dropins area to manage yourself. Take a look at ProfileSynchronizer in org.eclipse.equinox.p2.reconciler.dropins, in particular the method createProfileChangeRequest. I expect the uninstall behaviour you don't like is a result of the IInstallableUnit.PROP_PROFILE_LOCKED_IU property being added.
The dropins are reconciled at startup, see the p2.reconciler.dropins Activator.watchDropins(), you can likely do the same from your own bundle to watch another folder.
I suggest to deploy your plugin as an executable JAR. The installer in the JAR should ask for the Eclipse install directory and unpack the plugin in the right place (plus some more checks as needed).
Optionally include a little "watchdog" plugin which doesn't depend on much and just checks that your main plugin loads correctly and displays a useful error message which the user can email to you for support.
According to information in bug 311590 1 which is referenced in the deprecation comment of InstallCommand an alternative is possibly to use P2 operations 2, 3.

Modifying Existing Eclipse Plugin and Correctly Installing it

I downloaded the source code for the EMF based UML2 Plugin and changed a class in the org.eclipse.uml2.uml.edit project to remove special characters when returning string representations. Now when I export the projects and place the jar files either in the dropins directory or replace my current uml2 plugin jar files in plugins directory, The UML files are no longer recognized, in short my modified plugin does not install correctly (no error is thrown and I can see the files being picked up under Plugins->Target Platform) .
However, When I run the plugin as an eclipse application (from the workspace) I can see the changes I made being reflected in the new instance of eclipse.
What can I do to ensure that the plugin installs correctly?
Is there a documented procedure of how to build the uml2 plugin (or any comparable plugin) after modification?
Select the project and open the context menu. There is an entry PDE near the bottom of the menu. In there, you can find an entry to build the plugin for deployment. This gives you the features and plugins directory with the fixed files. Copy both into your Eclipse install.
Unless the UML2 plugins require some kind of magic build script, exporting the one plugin you changed and overwriting the original in your Eclipse installation should be the easiest solution. One potential problem which comes to mind is conflicting plugin version numbers: make sure you don't have two identical versions of your modified plugin in your Eclipse installation.
When debugging plugins which apparently don't work properly at runtime, I always look at Help > About Eclipse Platform > Configuration Details. This lists all the plugins found by Equinox during startup, along with their status (see the Javadoc of the org.osgi.framework.Bundle interface for explanation).
I faced the exact same problem as you describe here . I dont have any answer to your problem but i am sharing what worked for me .
I created a local update site of the plugin on my system. Create update site for your plug-in article explains very very nicely the steps needed to accomplish this .