Creating a custom Eclipse installation? - eclipse

I have a number of tools that I typically install with Eclipse, such as Subversive, PMD, EclEmma, etc. Every time I update Eclipse, I have to manually go through and add each of the tools as well. Is there a way to package the tools so I can install them together rather than individually?

I know of two possible solutions - none of them exactly what you ask for, but...
Use the Export wizard "Install" -> "Installed Software Items to File" to create a descriptive file with the features and update site you use. You get to choose which features to include. Also note that the generated p2f file does not include the binary features and plug-ins themselves - just a descriptive reference. (I should say, that I have had some problems with the corresponding import wizard, but YMMV...)
Alternatively, you can use the import wizard "Install" -> "From Existing Installation" to install features from an old(er) Eclipse installation into the new(er) Eclipse installation. It is a one time operation, and you can then update the installed features the usual way via the appropriate update sites (these are usually installed automaticaly).
Personally, I use the second method, as I then don't have to keep updating the p2f file whenever I find some new interesting features and - as noted above - the import wizard doesn't always work as I would expect.
I keep the old Eclipse installation around for some time anyway to ensure I have something to fall back on in case of problems...

First thing that comes to me is downloading every plugin you need. Store it in a folder and in the Eclipse Update dialog, select that folder in place of the URL.
Cannot remember if you also need to compile some sort of XML list of plugins installed.
With this setup, each time you install Eclipse, simply you use its update procedure and install every package you find using as Update Url your directory.
PS: Take a good look at this excellent question here on SO

Related

Upgrading STS with all plugins and settings

I was always disappointed when I have to update Springsource Toolsuite (would also apply to Eclipse, but I never had so much update issues with it), because it takes a rather long amount of time and update function inside of STS doesn't work that well. For example it was not possible for me to upgrade from 2.9.1 to 2.9.2, so I was forced to a reinstallation. In this question I want to show how I do this and I am hoping to get some feedback to improve this process:
I always ensure that I have this plugin installed from the market: P2 Installation Replication. It allows me to select and dump all my plugin info into a single XML file. So I start the old version of STS and dump my plugin list to a file with date in the file name to have different versions.
Then I close STS and rename the root directory to something like "springsource_old"
I download the new version as ZIP file and extract it in a single directory.
I use Lombok, so I download it and doubleclick on the JAR to install it for the chosen STS install location. Normally Lombok finds the installation if you stick to C:\springsource\.. or similar default locations.
Next I update the STS.INI file to force STS to use a specific version of the Java SDK with the -vm flag. If you have a lot of eclipse workspaces to manage it is also helpful to have them shown in the title bar of the window. So I include -showlocation in the INI file. It doesn’t have to appear first, just before -vmargs so that it doesn’t appear to be a JVM argument.
Then I start STS, choose the first workspace and close it again. This generates some preference files. What I want to have is the list of all workspaces. STS (Eclipse) is storing the workspace information in a preferences file called "org.eclipse.ui.ide.prefs".
This file is located under "%ECLIPSE_HOME%\configuration.settings" and contains a key named "RECENT_WORKSPACES". So open the file in the backup location, copy the entries, open the new generated file, and copy the settings into it. The next time I start STS, I can choose between all previous used workspaces again.
Even when no plugin is installed, STS (Eclipse) can natively open the files with the dumped plugins from step 1 (Import - Install - Install Software Items from File). It also allows to fetch the latest version instead of the version which was saved in the XML file. So I select and fetch all my missing plugins.
What is still missing from your experience? How could I improve this process? It still takes some time.
Update
Can't be that I am the only one who has problems with updating STS. Today the update from 3.1.0 to 3.2.0 came and now my STS looks like:
So I still have the issue that after every major update STS is not working anymore.
What exactly was the problem that you had? In general, you should be able to upgrade from a point release to the next point release with no problems (eg- from 2.9.1 to 2.9.2).
There was a problem at one point, which prevented you from upgrading, but that is fixed now. See here: http://forum.springsource.org/showthread.php?126775-Cannot-update-Grails-Support-from-2-9-1-to-2-9-2&p=413794#post413794
If you are having troubles upgrading, please post to the STS forum and paste the error that p2 is giving you with your message.
Sometimes, when upgrading you can look at the error message and see what component is not being found. You may need to add a new update site or de-select an incompatible feature.

Where does Eclipse store list of update sites? And can it be copied to another installation?

My Eclipse installation got completely borked and won't start up, so I will likely have to reinstall it (but this is also relevant when upgrading to a new Eclipse version). I want not to have to hunt down all the plugins I had installed. So where does Eclipse store list of available update sites? And if it isn't in plain text, can it be copied into another installation without problems?
Click on File->Export->Install (Installed Software Items to File)
sorry that I did not notice that your eclipse installation is not working. I don't think there is a direct solution to import the installs from eclipse config files (If you can't export from eclipse). Eclipse stores this configuration in the "articles.xml" files inside "eclipse/configuration/../../...."
e.g on my box I checked here:
eclipse/configuration/org.eclipse.osgi/bundles/293/data/-750392822/artifacts.xml
There will be many articles.xml files like this. I suggest to find one articles.xml files inside your broken eclipse path and then try importing that in new eclipse by help->install new softeare->(the click on) Available Software Sites->Import and then import these articles.xml files. To be honest, I did not try this, but would like to try this..
I don't know where it stores the websites but you can export/import sites from/to eclipse
There is a link like button named "Available Software Sites" on intall update/plugin window. There you can choose all the sites and export those sites and import on another eclipse installlation.

How does one migrate the list of plugins when updating Eclipse?

I usually install the new (yearly) release of Eclipse by moving the old one, then unpacking the new one in its place. In other words, a completely clean install. Is there a way to import the list of plugin URLs I had in the old Eclipse, so I can choose to update them in the new release?
I realise some of the URLs might be slightly different and require tweaking such as changing "helios" to "indigo"
Go to Window>Preferences>Install/Update>Available Software Sites, select all the sites you want to bring with you, and click "export".
You can also export your formatter and cleanup settings through the preferences menu.
Try copying your settings metadata into the new Eclipse. Typically that pulls in everything you need such as plugin websites. You still need to reinstall them however.
Or if you used dropins you can just copy them to the new dropins folder.

What are some RCP Deployment Options?

We have an RCP application and we are looking for a better way to do installation/updates. Currently to install, they just unzip a zip file. The zip file also contains scripts in it that are not java code. We were running into some bugs when updating if they don't first delete the old folder that was previous unzipped. The issue with deleting the folder is that the user loses the plugin preferences that were set. The installation would also need to register a COM server. The update would have to update the plugins and also replace the current script folder. What are some of the best options that could be used for installing and updating rcp apps? Thanks!
An option is to use the eclipse update mechanism. In this case the user would simply update like in the eclipse ide using help->software update. I have not used it myself yet ,but I have visited a tutorial from kai tödter, just google "eclipse rcp adanced kai tödter" und you will find some stuff, e.g. slides where he explains the updated mechanism as well as an example project "MP3 Manager" where you can find an example

Specific plugins per workspace

I came across this post and wondered if there is a way to activate only a few of all of my installed plugins depending on the workspace I currently work in.
For example - If I organized my workspaces like this
/workspaces
/java
/jee
/php
...
I don't need the Android-Plugin if I'm working on my Java EE-Projects and so on.
I also came accross this, suggesting to deactivate some capabilities for each workspace. But this not an option, as apparently no plugin is registered as capability.
Thanks, m
Edit: BTW, I am using Eclipse 3.5 Galileo
Maybe you can achieve your goal but it needs lots of "customization work" so I would not do it for myself :)
Create a "minimal" Eclipse install with plugins you use all of your workspaces.
Create one dropins folder for every workspace and put all of your "workspace-specific plugins" into that folder.
Create an Eclipse shortcut for all workspaces and use something like "-data _workspacedir_ -vmargs -Dorg.eclipse.equinox.p2.reconciler.dropins.directory=_dropindir_" in the shortcut.
Start eclipse with one of your new shortcuts.
Note that in this case you cannot switch workspace within Eclipse, you have to close the current one and start the new one using the corresponding shortcut.
UPDATE: I have found some Eclipse feature request for making this kind of setup easier if they will be implemented:
Software Update must allow to install plug-ins into extension location
Support for multiple bundle pools
You can use a different configuration folder for each Eclipse instance using the -configuration option when starting Eclipse.
On Windows, I would use a batch file (e.g. run-eclipse.cmd) which looks a bit like this (a bit different on Unix, more complex on OS X because of the app packaging):
eclipsec.exe -clean -configuration configs/%1/configuration
Execute it with your environment ID (e.g. run-eclipse.cmd java). I use eclipsec because I need the console output, but you can use the plain eclipse.exe executable. The -clean is not mandatory either.
Under my Eclipse installation folder, I will have a configs folder and under this folder I will have multiple configurations. Each config folder can have its' own plugins and folders. AFAIK, if you install plugins they will be installed in your configuration folder and not your main installation folder.
The structure you get is like this:
Eclipse Folder
plugins
features
configs
java
plugins
features
configuration
Eclipse plugins are expected to start only as needed, in a lazy manner. I'm not saying that all behave exactly that way, but if you write your own plugin, you'll see this is how the technology works, your plugin gets called only as needed.
So in Eclipse, if you configure your starting Perspective (Java for me) to have only the Views you need, the plugins that are used for other views should not be started.
To do this, take the view away and save your perspective (Windows - Save perspective as).
In addition, in Ganymede, in Windows - Preferences - General - Startup and Shutdown,
there is a list of plugins that should be started on startup, so you can edit that list.
I didn't try to see if this works per workspace though.
Although my solution won't let you install plugins per workspace but will solve the problem.
The best way i found to do this is using different eclipse copies:
Extract officialeclipse.zip to two different places and install plugins you like per eclipse.
A bit late answer but if you want to manage many workspaces shortcut the following tool is very simple and helpful : http://www.xdreamteam.ch/downloads/eclipselauncher/
I use it for sorting my projects by customers and workspaces, and it launch the right workspace with all the necessary configurations needed for each.