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