You can create the patch and make it work for you in the following four phases:
Phase 1: Create a plug-in project for the plug-in you need to patch.
- Create a new workspace (recommended) or open an existing one.
- Select
File
->Import
- Expand
Plug-in Development
, selectPlug-ins and Fragments
, then clickNext
- In the
Import As
section, selectProjects with source folders
and then clickNext
. - Enter (or copy & paste, no quotes)
org.eclipse.wst.server.preview.adapter
intoID
field at the top and clickAdd All
. This should move this one plug-in to the right pane. - Click
Finish
to import the "org.eclipse.wst.server.preview.adapter" plug-in source into a project. - Expand the root of the project and ensure it contains a folder named "src". You will only get the "src" folder if you have the "WST Server Adapter Plug-in Developer Resources" installed.
Phase 2: Apply the changes needed to update the plug-in. Since there is a bug with a patch attached that can be used to apply the changes, the following steps will take advantage of that
.
- Open Bug 402848 in a browser.
- Click on the
Patch v1.0 for 3.4.2p
attachment link to open the patch. - Starting with the second occurrence of a line starting with
---
, select this line through the end of the text and copy it to the clipboard. This contains the changes to the PreviewLaunchConfigurationDelegate.java file which is where the fix is needed. You don't want the upper portion of the patch as that would change the version of the plug-in, and that would complicate things. - Back in Eclipse, right-click on the "org.eclipse.wst.server.preview.adapter" project. Select
Team
and click onApply Patch
. - Leave Clipboard selected and click
Next
. - Ensure the "org.eclipse.wst.server.preview.adapter" project is
selected, and click
Next
. - Set the
Ignore leading path name segments
to 3. The "Patch Contents" window should change to have a blue left pointing arrow instead of red x indicators. - Click
Finish
to apply the changes.
Phase 3: Create the replacement jar. Due to the approach in Phase 1, the name of this jar will be identical to your current jar, which simplifies updating the Eclipse installation.
- Right-click on the
org.eclipse.wst.server.preview.adapter
project in the Project Explorer or other navigator view and selectExport
- Expand
Plug-in Development
, selectDeployable plug-ins and fragments
, then clickNext
- Click the
Browse
button next to the Directory selection in the Destination tab followed by OK. This will set the output directory to be the same as your workspace. - Click
Finish
to build the replacement plug-in jar. It will appear in a "plugins" folder under the root of your workspace.
Phase 4: Replace the installed plug-in jar with the fixed version.
- Exit Eclipse if it is running.
- Under the "plugins" folder of your Eclipse installation, move or rename the org.eclipse.wst.server.preview.adapter_1.1.101.v20121107_1651.jar if you don't want to overwrite it with the patched version (mentioned in step 3 below). If you have a different version, it means you aren't using Juno SR2 and hopefully you installed the "WST Server Adapter Plug-in Developer Resources" that matched your version.
- Copy the org.eclipse.wst.server.preview.adapter_1.1.101.v20121107_1651.jar from the "plugins" folder under your workspace and paste it to the "plugins" folder of your Eclipse installation.
You should be able to run Eclipse now with the fixed plug-in. Because the patched jar had the same version number, no additional changes are needed.
Hope it helps !