Version 65.1 by pgr on 2010/02/18 22:07

Show last authors
1 The following are instructions on how to setup Eclipse / WOLips so you can work with mulitple versions of WebObjects. This tutorial will demonstrate setting up your environment simply for WebObjects 5.3.3 and 5.4.3 but there's no reason you can't have different setups based on customer or project instead.
2
3 ==== Create New Directory Structure ====
4
5 [[image:http://wiki.objectstyle.org/confluence/download/attachments/5275708/media_1245674441767.png?version=10||align="centre"]]
6
7 The first thing we need to do is to create a new directory structure to allow for multiple versions of WebObjects to be installed in. This new directory structure basically creates a new root level that WOLips will look in for all frameworks used by a given project or workspace. This directory structure can be anything you wish. For demonstration purposes, I'm going to create it under the ##/Developer## directory.
8
9 Create: ##/Developer/WebObjects/Versions/##
10
11 ==== Download WOInstaller.jar ====
12
13 [[image:http://wiki.objectstyle.org/confluence/download/attachments/5275708/media_1245677004032.png?version=10||align="centre"]]
14
15 We now need to download the ##WOInstaller.jar## file from ##http:~/~/webobjects.mdimension.com/wolips/## and save it into the ##Versions/## directory we just created.
16
17 ==== Use WOInstaller.jar to download WebObjects ====
18
19 [[image:http://wiki.objectstyle.org/confluence/download/attachments/5275708/media_1245678323686.png?version=10||align="centre"]]
20
21 Open Terminal.app and run one of the following commands:
22
23 {{noformat}}
24
25 java -jar /Developer/WebObjects/Versions/WOInstaller.jar 5.3.3 /Developer/WebObjects/Versions/WebObjects533
26 java -jar /Developer/WebObjects/Versions/WOInstaller.jar 5.4.3 /Developer/WebObjects/Versions/WebObjects543
27
28 {{/noformat}}
29
30 (depending upon which version of WebObjects you would like to download.)
31
32 ==== Installed Versions ====
33
34 [[image:http://wiki.objectstyle.org/confluence/download/attachments/5275708/media_1245679408792.png?version=10||align="centre"]]
35
36 When the script has finished downloading, your directory should look something like this. At this point you could rename the directory to something like MyCustomer or MyProject. For this demonstration we'll just leave it named as is.
37
38 ==== Open Eclipse / WOLips ====
39
40 [[image:http://wiki.objectstyle.org/confluence/download/attachments/5275708/media_1245679819648.png?version=10||align="centre"]]
41
42 You need to launch Eclipse and WOLips at least once so that it will create the default ##wolips.properties## file in ##,,/Library/Application Support/WOLips/,,##,,. If you've already been using WOlips, you can skip this step.,,
43
44 {{note title="Note"}}
45
46 Feb 12, 2010: At least with WOLips 3.4.5830, launching Eclipse/WOLips is not sufficient to get it to create the default {{wolips.properties}}. You need to create a project; a new WebObjects Application project will do nicely.
47
48 {{/note}}
49
50 ==== Make a copy of the default ##wolips.properties## file ====
51
52 [[image:http://wiki.objectstyle.org/confluence/download/attachments/5275708/media_1245680007266.png?version=10||align="centre"]]
53 Select the ##wolips.properties## file and make a copy of it. Then rename the copy to be ##wolips.yourversion.properties##. In reality, you can rename it however you'd like (for example: ##wolips.properties.533## or ##533.wolips.properties##), but I find that putting the version number in the middle (e.g. ##wolips.533.properties##) will keep all the different versions together, and will not mess with the extension mapping.
54
55 ==== Modify your new ##wolips.533.properties## file to point to your newly downloaded version of WebObjects ====
56
57 As an example, if you downloaded WebObjects 5.3.3 into ##/Developer/WebObjects/Versions/WebObjects533##, then modify your new ##wolips.533.properties## file as follows (substituting your username for ##bubba##, of course):
58
59 {{noformat}}
60
61 wo.network.root=/Network
62 wo.system.root=/Developer/WebObjects/Versions/WebObjects533/System
63 wo.local.root=/Developer/WebObjects/Versions/WebObjects533
64 wo.user.root=/Users/bubba
65
66 wo.network.frameworks=/Network/Library/Frameworks
67 wo.system.frameworks=/Developer/WebObjects/Versions/WebObjects533/System/Library/Frameworks
68 wo.local.frameworks=/Developer/WebObjects/Versions/WebObjects533/Library/Frameworks
69 wo.user.frameworks=/Users/bubba/Library/Frameworks
70
71 wo.bootstrapjar=/Developer/WebObjects/Versions/WebObjects533/System/Library/WebObjects/JavaApplications/wotaskd.woa/WOBootstrap.jar
72 wo.extensions=/Developer/WebObjects/Versions/WebObjects533/Library/WebObjects/Extensions
73 wo.apps.root=/Developer/WebObjects/Versions/WebObjects533/Library/WebObjects/Applications
74
75 wo.api.root=/Developer/Documentation/DocSets/com.apple.ADC_Reference_Library.WebObjectsReference.docset/Contents/Resources/\
76 Documents/documentation/InternetWeb/Reference/WO542Reference
77
78 {{/noformat}}
79
80 ==== Configure Eclipse to use your newly installed version of WebObjects ====
81
82 Eclipse needs to be able to reference your ##wolips.533.properties## file, so that it can locate all the resources needed in order to build and to run your projects.
83
84 Here you have two options:
85
86 * you can set a workspace-wide preference to use a particular ##wolips.properties## file
87 * you can configure an individual project to use a particular ##wolips.properties## file
88
89 Neither approach is without its problems. Read on...
90
91 ===== Option 1 - Configure the Eclipse workspace to reference your new ##wolips.properties## file =====
92
93 [[image:http://wiki.objectstyle.org/confluence/download/attachments/5275708/media_1245680796194.png?version=10||align="centre"]]
94
95 With this option, we're telling the Eclipse/WOLips internal incremental builder to reference a specific ##wolips.properties## file for the entire workspace (rather than using the default, which is ##$HOME/Library/Application Support/WOLips/wolips.properties##). And by doing this, we're implicitly telling Eclipse which installation of WebObjects we want it to use.
96
97 To change this setting, go to the "Eclipse" menu, select "Preferences", open the "WOLips" preference group, then select "Build". Enter the name of your new ##wolips.properties## file. Note that this can be either an absolute or relative filename. Relative filenames are relative to your ##$HOME/Library/Application Support/WOLips/## directory.
98
99 Although in some cases you can get WOLips to use your new ##wolips.properties## via a Clean/Rebuild, or by closing/reopening your project, it's probably wise to just restart Eclipse, to make sure the change is "refreshed" for all your open projects. And then a Clean/Rebuild may also be in order.
100
101 Eclipse/WOLips will also use this setting to find the referenced resources at runtime, i.e. when your run your project from within Eclipse.
102
103 {{note title="Note"}}
104
105 This setting currently affects only the Eclipse _internal_ builder - it will not influence external builds with Ant. That is, when you build your project (e.g. for deployment) using any of the following:
106 - Ctrl-click {{build.xml}} -> Run As -> Ant Build
107 - WOLips Ant Tools -> Install
108 - build with Ant from the command line
109
110 ...this setting will not affect where Ant looks for the various resources specified by the settings in your alternate {{wolips.properties}}.
111
112 In order to configure Ant so that it can find your {{wolips.properties}}-specified resources, you'll need to use Option 2, below.
113
114 {{/note}}
115
116 ===== Option 2 - Configure your project to reference your new ##wolips.properties## file =====
117
118 [[image:build.properties.png||align="centre"]]
119
120 Currently, the Eclipse Ant builder is not controlled by the "WOLips -> Build" setting in Eclipse's Preferences. In order to build with Ant, you first need to tell Ant where to find your WebObjects installation and other resources. Your project's default Ant buildfile, ##build.xml## (which is created by WOLips when you create a new WebObjects application project), reads and uses the properties found in your ##$HOME/Library/Application Support/WOLips/wolips.properties## file. But you can specify a different ##wolips.properties## file by adding a line like the following to your project's ##build.properties## file:
121
122 {{noformat}}
123
124 wolips.properties=/Users/bubba/Library/Application Support/WOLips/wolips.533.properties
125
126 {{/noformat}}
127
128 {{note}}
129
130 Note that for now (as of WOLips version 3.4.5830), this really must be an absolute, fully-qualified filepath; if you were to specify a relative filename, Eclipse/WOLips would treat it as being relative to {{$HOME/Library/Application Support/WOLips}}, but Ant (using the default {{build.xml}}) would treat it as being relative to your project's base folder.
131
132 Also, you might think you could use an Ant variable specification such as $\{user.home\} on the right hand side -- but you can't. The problem is that while Ant would interpret this correctly, Eclipse/WOLips will not. Also note that you can't in any case use a tilde character as an abbreviation for your home directory.
133
134 {{/note}}
135
136 If you specify a ##wolips.properties## setting this way, it will override the workspace-wide WOLips preference setting.
137
138 Eclipse will also use this setting to find resources at runtime, i.e. when you run your project from within Eclipse.
139
140 ==== OPTIONAL - Building your project from the Command Line Using Ant ====
141
142 If you want to build your project with Ant from the command line, you need to tell Ant two things:
143
144 ===== (1) The location of the WOLips ##woproject.jar## file: =====
145
146 You can do this either via the ##-lib## parameter to the ##ant## command, e.g.
147
148 {{noformat}}
149
150 ant -lib /path/to/woproject.jar
151
152 {{/noformat}}
153
154 or by putting a copy of ##woproject.jar## someplace where Ant will find it. A convenient location for it is your ##$HOME/.ant/lib## folder:
155
156 {{noformat}}
157
158 mkdir -p ~/.ant/lib
159 cp -p /Applications/eclipse-3.4.2/plugins/org.objectstyle.wolips.woproject.ant_3.4.5830/lib/woproject.jar ~/.ant/lib
160
161 {{/noformat}}
162
163 ===== (2) The location of your ##wolips.properties## file: =====
164
165 If you already specified this in your ##build.properties## (as per Option 2, above), then you're done. But perhaps you have no interest in building with Ant from within Eclipse, but only want to be able to do Ant builds from the command line. If that's the case, then you can use Ant's ##-D<property>=<value>## command line option to set the value of the ##wolips.properties## Ant property to be the path to your ##wolips.properties## file. Ant will read and process the file specified by the ##wolips.properties## property during the course of processing your ##build.xml##. Again, this path specification can be absolute or relative; but if it's relative, Ant will interpret it as being relative to your project's base folder.
166
167 Example:
168
169 {{noformat}}
170 $ ant -Dwolips.properties=/Users/bubba/Library/Application\ Support/WOLips/wolips.533.properties clean build
171 {{/noformat}}
172
173 As above, you cannot use a tilde character as an abbreviation for your home directory (but you in fact //could// use an environment variable such as ##$HOME## - the shell would expand it before passing it to ant).
174
175 ==== OPTIONAL - Building your project using Hudson ====
176
177 {{tip title="Shameless Plug"}}
178 Come to [WOWODC-East|http://www.wocommunity.org/wowodc09/east/index.html] for hands-on labs demonstrating how to integrate multiple WebObjects installations with Hudson.
179 {{/tip}}