Last modified by Pascal Robert on 2012/07/21 20:39
From version 63.1
edited by Pascal Robert
on 2012/07/21 20:39
on 2012/07/21 20:39
Change comment:
There is no comment for this version
To version 64.1
edited by Pascal Robert
on 2012/07/21 20:39
on 2012/07/21 20:39
Change comment:
Migrated to Confluence 4.0
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -5,10 +5,10 @@ 5 5 == WOLips 3.4.x, and later, Side-note == 6 6 7 7 {{warning}} 8 -If you are updating an older project, make sure you get the latest build.xml file. 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 9 {{/warning}} 10 10 11 -For WOLips 3.4.x and later, while embedding is built-in, it's not enabled by default. 11 +For WOLips 3.4.x and later, while embedding is built-in, it's not enabled by default. To enable embedding: 12 12 13 13 * make sure you are in the WO Explorer view 14 14 * right-click your project folder, select Properties, select WOLips Deployment ... ... @@ -18,51 +18,47 @@ 18 18 19 19 * make sure you are in the Navigator view 20 20 * edit build.properties, and add: 21 -* ##build.app.name=MyApp-2009-07-14##21 +* {{code language="none"}}build.app.name=MyApp-2009-07-14{{/code}} 22 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. 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 24 25 -* ##setFrameworksBaseURL("/WebObjects/MyApp-2009-07-14.woa/Frameworks");##25 +* {{code language="none"}}setFrameworksBaseURL("/WebObjects/MyApp-2009-07-14.woa/Frameworks");{{/code}} 26 26 27 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 28 29 -* ##frameworksBaseURL=/WebObjects/$build.app.name.woa/Frameworks##29 +* {{code language="none"}}frameworksBaseURL=/WebObjects/${build.app.name}.woa/Frameworks{{/code}} 30 30 31 31 == Introduction == 32 32 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.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. 34 34 35 35 == Pre-requisites == 36 36 37 -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) 38 38 39 39 {{info title="Modern WebObjects Project Layout"}} 40 - 41 41 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. 42 42 43 -!modern_project_layout.jpg! 44 - 42 +[[image:attach:modern_project_layout.jpg]] 45 45 {{/info}} 46 46 47 47 == Installation and Usage of the Script == 48 48 49 -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.xml47 +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 50 50 51 -* 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. 52 52 * Drag it to the root of your project. 53 53 54 -* 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. 55 55 56 56 {{info title="Using the Ant Script"}} 57 - !running_the_script.jpg! 58 - 55 +[[image:attach:running_the_script.jpg]] 59 59 {{/info}} 60 60 61 -* 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". 62 62 63 63 {{info title="Configure the Ant Tasks to be run"}} 64 - !ant_tasks.jpg! 65 - 61 +[[image:attach:ant_tasks.jpg]] 66 66 {{/info}} 67 67 68 68 * Click the Run button to run the ant script and your fully embedded split install deployment bundles will be created in the "dist" folder. ... ... @@ -78,8 +78,7 @@ 78 78 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. 79 79 80 80 {{info title="Customizing the Application Build Name"}} 81 - !custom_app_name.jpg! 82 - 77 +[[image:attach:custom_app_name.jpg]] 83 83 {{/info}} 84 84 85 85 == Features == ... ... @@ -91,15 +91,13 @@ 91 91 * 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. 92 92 * Compressed gzipped tar archives of both application and webserver bundles are created, ready for copying to target server(s) 93 93 ** This is easily decompressed on the server using 94 -** $ sudo tar xvzf bundle.tar.gz 89 +** $ sudo tar -xvzf bundle.tar.gz 95 95 96 96 == Anatomy of Embedded Split Install Bundles produced by this Ant Script == 97 97 98 98 {{info title="The Deployment Files"}} 99 - 100 100 The two compressed "ready-to-deploy" bundles are highlighted below 101 -!build_artifacts.jpg! 102 - 95 +[[image:attach:build_artifacts.jpg]] 103 103 {{/info}} 104 104 105 105 The notable aspects of the embedded build structure are shown below. ... ... @@ -107,11 +107,10 @@ 107 107 === Application Bundle === 108 108 109 109 {{info title="Embedded Application Bundle Layout"}} 103 +[[image:attach:app_bundle_layout.jpg]] 110 110 111 -!app_bundle_layout.jpg! 112 112 * 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. 113 113 * Examining the Contents/MacOS/MacOSClassPath.txt file will reveal that the java classpath refers to all the jars inside the embedded bundle. 114 - 115 115 {{/info}} 116 116 117 117 The application bundle typically gets installed as follows: ... ... @@ -118,13 +118,12 @@ 118 118 119 119 * Install Location = /Library/WebObjects/Applications/ 120 120 * chown (ownership) = appserver:appserveradm 121 -* chmod (permissions) = 755 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) 122 122 123 123 === WebServer Bundle === 124 124 125 125 {{info title="Embedded WebServer Bundle Layout"}} 126 - !webserver_bundle_layout.jpg! 127 - 118 +[[image:attach:webserver_bundle_layout.jpg]] 128 128 {{/info}} 129 129 130 130 The webserver bundle typically gets installed as follows: