Last modified by Pascal Robert on 2012/07/21 20:39

From version 59.1
edited by Pascal Robert
on 2009/07/12 17:29
Change comment: There is no comment for this version
To version 64.1
edited by Pascal Robert
on 2012/07/21 20:39
Change comment: Migrated to Confluence 4.0

Summary

Details

Page properties
Content
... ... @@ -2,41 +2,63 @@
2 2  This script can be used for WOLips 3.3.x only, the build.xml in WOLips 3.4.x and later already have the split install/embedded stuff built-in.
3 3  {{/warning}}
4 4  
5 +== WOLips 3.4.x, and later, Side-note ==
6 +
7 +{{warning}}
8 +If you are updating an older project, make sure you get the latest build.xml file. Create a new project, then copy/paste the contents of the fresh build.xml file into your project's build.xml file.
9 +{{/warning}}
10 +
11 +For WOLips 3.4.x and later, while embedding is built-in, it's not enabled by default. To enable embedding:
12 +
13 +* make sure you are in the WO Explorer view
14 +* right-click your project folder, select Properties, select WOLips Deployment
15 +* check the related, if not all, options under Embed Frameworks
16 +
17 +To create a versioned/dated bundle of your app and resources:
18 +
19 +* make sure you are in the Navigator view
20 +* edit build.properties, and add:
21 +* {{code language="none"}}build.app.name=MyApp-2009-07-14{{/code}}
22 +
23 +There is a known bug with WO 5.4.x (for those not using the latest Wonder release) regarding proper linking to your web server resources within the embedded frameworks. The WOFrameworksBaseURL isn't set correctly. To do this you'll need to programmatically set this within your Application constructor:
24 +
25 +* {{code language="none"}}setFrameworksBaseURL("/WebObjects/MyApp-2009-07-14.woa/Frameworks");{{/code}}
26 +
27 +Within build.properties (I may need to be corrected on this), the best approach to linking your embedded framework's web server resources automatically is to include (however the bug noted above breaks this):
28 +
29 +* {{code language="none"}}frameworksBaseURL=/WebObjects/${build.app.name}.woa/Frameworks{{/code}}
30 +
5 5  == Introduction ==
6 6  
7 -The previous tutorial articles provide details of customization of the default ant build script that is present in your WebObjects projects. This article provides a fully custom build script that you can just drop into your project and use it as an alternative to the default build.xml. This script is called the "split//embedded//build" script. Along with providing the script, this article explains in detail what deployment artifacts are produced by the build. Hopefully the functionality in this script will make their way into the standard script someday with configuration parameters settable in a simple way in the build.properties file.
33 +The previous tutorial articles provide details of customization of the default ant build script that is present in your WebObjects projects. This article provides a fully custom build script that you can just drop into your project and use it as an alternative to the default build.xml. This script is called the "split_embedded_build" script. Along with providing the script, this article explains in detail what deployment artifacts are produced by the build. Hopefully the functionality in this script will make their way into the standard script someday with configuration parameters settable in a simple way in the build.properties file.
8 8  
9 9  == Pre-requisites ==
10 10  
11 -This [[script>>^split_embedded_build.xml]] only works with the modern WOLips project format and the WOnderApplication project template format (since the layout of regular projects is now similar to Wonder layout). However the script is easily changed to accommodate the "old" standard format by changing the dir names in the script (for example "Sources" in the new project layout was "src" in the old layout)
37 +This [[script>>attach:split_embedded_build.xml]] only works with the modern WOLips project format and the WOnderApplication project template format (since the layout of regular projects is now similar to Wonder layout). However the script is easily changed to accommodate the "old" standard format by changing the dir names in the script (for example "Sources" in the new project layout was "src" in the old layout)
12 12  
13 13  {{info title="Modern WebObjects Project Layout"}}
14 -
15 15  This layout is the standard layout for all WebObjects projects created by WOLips (rev #4735 at least). The distinct folder names indicate if your project is in this modern format and if yours is the same, then this ant script should work.
16 16  
17 -!modern_project_layout.jpg!
18 -
42 +[[image:attach:modern_project_layout.jpg]]
19 19  {{/info}}
20 20  
21 21  == Installation and Usage of the Script ==
22 22  
23 -Have no fear ;-) , you will not break anything by dropping this script as is into your project and trying it out. You can just use it as is without replacing your default build.xml
47 +Have no fear , you will not break anything by dropping this script as is into your project and trying it out. You can just use it as is without replacing your default build.xml
24 24  
25 -* So, download the [[script>>^split_embedded_build.xml]] by right-clicking this [[link>>^split_embedded_build.xml]] and selecing Save As... or whatever your browser uses for saving contents at a link destination.
49 +* So, download the [[script>>attach:split_embedded_build.xml]] by right-clicking this [[link>>attach:split_embedded_build.xml]] and selecing Save As... or whatever your browser uses for saving contents at a link destination.
26 26  * Drag it to the root of your project.
27 27  
28 -* Open the Ant run configuration for the script by right-clicking on the script and selecting the menu shown below.
52 +* Open the Ant run configuration for the script by right-clicking on the script and selecting the menu shown below.
29 29  
30 30  {{info title="Using the Ant Script"}}
31 - !running_the_script.jpg!
32 -
55 +[[image:attach:running_the_script.jpg]]
33 33  {{/info}}
34 34  
35 -* Next select the "clean" and compileAndBuild" tasks. If necessary use the "Order..." button to ensure that "clean" comes before "compileAndBuild".
58 +* Next select the "clean" and compileAndBuild" tasks. If necessary use the "Order..." button to ensure that "clean" comes before "compileAndBuild".
36 36  
37 37  {{info title="Configure the Ant Tasks to be run"}}
38 - !ant_tasks.jpg!
39 -
61 +[[image:attach:ant_tasks.jpg]]
40 40  {{/info}}
41 41  
42 42  * Click the Run button to run the ant script and your fully embedded split install deployment bundles will be created in the "dist" folder.
... ... @@ -52,8 +52,7 @@
52 52  OK, so getting to the point, an optional custom app name can be set in the project's build.properties file by simply adding a property "build.app.name" as shown below.
53 53  
54 54  {{info title="Customizing the Application Build Name"}}
55 - !custom_app_name.jpg!
56 -
77 +[[image:attach:custom_app_name.jpg]]
57 57  {{/info}}
58 58  
59 59  == Features ==
... ... @@ -65,15 +65,13 @@
65 65  * Self-contained deployment bundles - all required frameworks are embedded - minimal dependency on target server configuration and versions. For example, there is no need to install Wonder frameworks on your deployment server since the ones you developed and tested with are embedded in the deployment bundles. Experience has shown that this improves consistency of deployment reliability.
66 66  * Compressed gzipped tar archives of both application and webserver bundles are created, ready for copying to target server(s)
67 67  ** This is easily decompressed on the server using
68 -** $ sudo tar xvzf bundle.tar.gz
89 +** $ sudo tar -xvzf bundle.tar.gz
69 69  
70 70  == Anatomy of Embedded Split Install Bundles produced by this Ant Script ==
71 71  
72 72  {{info title="The Deployment Files"}}
73 -
74 74  The two compressed "ready-to-deploy" bundles are highlighted below
75 -!build_artifacts.jpg!
76 -
95 +[[image:attach:build_artifacts.jpg]]
77 77  {{/info}}
78 78  
79 79  The notable aspects of the embedded build structure are shown below.
... ... @@ -81,11 +81,10 @@
81 81  === Application Bundle ===
82 82  
83 83  {{info title="Embedded Application Bundle Layout"}}
103 +[[image:attach:app_bundle_layout.jpg]]
84 84  
85 -!app_bundle_layout.jpg!
86 86  * Opening the app executable (command line script at bundle root having the application name as its name) and looking at the end will reveal that the WOFrameworksBaseURL references the frameworks inside the webserver embedded bundle.
87 87  * Examining the Contents/MacOS/MacOSClassPath.txt file will reveal that the java classpath refers to all the jars inside the embedded bundle.
88 -
89 89  {{/info}}
90 90  
91 91  The application bundle typically gets installed as follows:
... ... @@ -92,13 +92,12 @@
92 92  
93 93  * Install Location = /Library/WebObjects/Applications/
94 94  * chown (ownership) = appserver:appserveradm
95 -* chmod (permissions) = 755 (750 if you wish, but your server login id needs to be a member of appserveradm group to cd into the bundle)
113 +* chmod (permissions) = 755 (750 if you wish, but your server login id needs to be a member of appserveradm group to cd into the bundle)
96 96  
97 97  === WebServer Bundle ===
98 98  
99 99  {{info title="Embedded WebServer Bundle Layout"}}
100 - !webserver_bundle_layout.jpg!
101 -
118 +[[image:attach:webserver_bundle_layout.jpg]]
102 102  {{/info}}
103 103  
104 104  The webserver bundle typically gets installed as follows: