Changes for page Packaging WO Applications as true WAR with Maven
Last modified by Ulrich Köster on 2009/08/02 20:26
From version 25.1
edited by Henrique Prange
on 2009/08/02 20:26
on 2009/08/02 20:26
Change comment:
Migrated to Confluence 5.3
To version 12.1
edited by Henrique Prange
on 2008/05/15 19:27
on 2008/05/15 19:27
Change comment:
There is no comment for this version
Summary
-
Page properties (3 modified, 0 added, 0 removed)
-
Attachments (0 modified, 0 added, 2 removed)
Details
- Page properties
-
- Parent
-
... ... @@ -1,1 +1,0 @@ 1 -WOProject-Maven - Tags
-
... ... @@ -1,1 +1,0 @@ 1 -favourite - Content
-
... ... @@ -1,10 +1,10 @@ 1 -If you have used the [[ doc:woapplication-archetype]] to create your project, jump to the step 3.1 +If you have used the [[woapplication-archetype]] to create your project, jump to the step 3. 2 2 3 3 You have to follow some instructions to build a true WAR package: 4 4 5 5 == Step 1: Create a web.xml file == 6 6 7 -You need to create a web.xml file. You can download a simple web.xml file [[here >>attach:web.xml]]. Don't forget to change the displayName and the WOMainBundle properties:7 +You need to create a web.xml file. You can download a simple web.xml file [[here|]]. Don't forget to change the displayName and the WOMainBundle properties: 8 8 9 9 {{noformat}} 10 10 ... ... @@ -23,7 +23,7 @@ 23 23 24 24 == Step 2: Create/generate an Info.plist file == 25 25 26 -You also need to create or generate a valid Info.plist file into your resources folder. [[Here >>attach:Info.plist]] is a sample Info.plist. You have to change the ${your-app-name}and ${package}occurrences with the respective application name and Application class package.26 +You also need to create or generate a valid Info.plist file into your resources folder. [[Here|]] is a sample Info.plist. You have to change the $your-app-name and $package occurrences with the respective application name and Application class package. 27 27 28 28 == Step 3: Package your classes, resources and webserver resources == 29 29 ... ... @@ -32,26 +32,7 @@ 32 32 {{noformat}} 33 33 34 34 <build> 35 - ... 36 - <resources> 37 37 ... 38 - <resource> 39 - <targetPath>Resources</targetPath> 40 - <directory>${basedir}/src/main/resources</directory> 41 - </resource> 42 - <resource> 43 - <targetPath>Resources</targetPath> 44 - <directory>${basedir}/src/main/components</directory> 45 - </resource 46 - <resource> 47 - <targetPath>WebServerResources</targetPath> 48 - <directory>${basedir}/src/main/webserver-resources</directory> 49 - </resource> 50 - ... 51 - </resources> 52 - ... 53 - <plugins> 54 - ... 55 55 <plugin> 56 56 <artifactId>maven-war-plugin</artifactId> 57 57 <configuration> ... ... @@ -59,8 +59,6 @@ 59 59 </configuration> 60 60 </plugin> 61 61 ... 62 - </plugins> 63 - ... 64 64 </build> 65 65 66 66 {{/noformat}} ... ... @@ -72,7 +72,7 @@ 72 72 {{noformat}} 73 73 74 74 <dependency> 75 - <groupId>com.webobjects</groupId> 54 + <groupId>com.apple.webobjects</groupId> 76 76 <artifactId>JavaWOJSPServlet</artifactId> 77 77 <version>${woversion}</version> 78 78 </dependency> ... ... @@ -84,7 +84,7 @@ 84 84 {{noformat}} 85 85 86 86 <dependency> 87 - <groupId>com.webobjects</groupId> 66 + <groupId>com.apple.webobjects</groupId> 88 88 <artifactId>JavaWOJSPServlet_client</artifactId> 89 89 <version>${woversion}</version> 90 90 </dependency> ... ... @@ -91,23 +91,11 @@ 91 91 92 92 {{/noformat}} 93 93 94 -**NOTE**: If your application uses Wonderyou mustaddtheERXServletdependency:73 +**NOTE**: if your application uses Wonder, please read [[this tutorial>>http://wiki.objectstyle.org/confluence/display/WONDER/Creating+a+wonder+app+to+deploy+as+a+servlet]]. 95 95 96 -{{noformat}} 97 - 98 -<dependency> 99 - <groupId>wonder.core</groupId> 100 - <artifactId>ERServlet</artifactId> 101 - <version>1.0</version> 102 -</dependency> 103 - 104 -{{/noformat}} 105 - 106 -Read this [[tutorial>>url:http://wiki.objectstyle.org/confluence/display/WONDER/Creating+a+wonder+app+to+deploy+as+a+servlet||shape="rect"]] to find how to configure the ERXServletAdaptor in your application. 107 - 108 108 == Step 5: Change the packaging type == 109 109 110 -The default [[maven-war-plugin>>url:http://maven.apache.org/plugins/maven-war-plugin/||shape="rect"]]can handle the war packaging correctly. You have to change the packaging of your POM to 'war' in order to use this plug-in:77 +The default maven-war-plugin can handle the war packaging correctly. You have to change the packaging of your POM to 'war' in order to use this plug-in: 111 111 112 112 {{noformat}} 113 113 ... ... @@ -117,55 +117,9 @@ 117 117 118 118 It's done. 119 119 120 -== Step 6: Filtering variables with Maven (OPTIONAL) == 121 - 122 -Maven supports variable substitution during build time. It is called resource filtering. You can find more information about resource filtering [[here>>url:http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html||shape="rect"]] and [[here>>url:http://www.sonatype.com/books/maven-book/reference/resource-filtering-sect-description.html||shape="rect"]]. 123 - 124 -If you are using variables in your resource files (i.e. the Info.plist), you have to configure Maven to filter the Resources folder like this: 125 - 126 -{{noformat}} 127 - 128 -<build> 129 - ... 130 - <resources> 131 - ... 132 - <resource> 133 - <targetPath>Resources</targetPath> 134 - <directory>${basedir}/src/main/resources</directory> 135 - <filtering>true</filtering> 136 - </resource> 137 - ... 138 - </resources> 139 - ... 140 -</build> 141 - 142 -{{/noformat}} 143 - 144 -If you are using variables in the web.xml file, you have to configure Maven to filter deployment descriptors like this: 145 - 146 -{{noformat}} 147 - 148 -<build> 149 - ... 150 - <plugins> 151 - ... 152 - <plugin> 153 - <artifactId>maven-war-plugin</artifactId> 154 - <configuration> 155 - ... 156 - <filteringDeploymentDescriptors>true</filteringDeploymentDescriptors> 157 - </configuration> 158 - </plugin> 159 - ... 160 - </plugins> 161 - ... 162 -</build> 163 - 164 -{{/noformat}} 165 - 166 166 = Running your application as true WAR = 167 167 168 -You can use the [[maven-jetty-plugin>>url:http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin||shape="rect"]]to run and test your application.89 +You can use the maven-jetty-plugin to run and test your application. 169 169 170 170 == Step 1: Configure the maven-jetty-plugin == 171 171 ... ... @@ -196,4 +196,4 @@ 196 196 197 197 == Step 3: See the result == 198 198 199 -Open a browser and type the URL for your application like this: [[http:~~/~~/locahost:8080/your-app-name/WebObjects/>>url:http://locahost:8080/your-app-name/WebObjects/||shape="rect"]]120 +Open a browser and type the URL for your application like this: http:~/~/locahost:8080/your-app-name/WebObjects/
- Info.plist
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.XWikiGuest - Size
-
... ... @@ -1,1 +1,0 @@ 1 -1.3 KB - Content
- web.xml
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.XWikiGuest - Size
-
... ... @@ -1,1 +1,0 @@ 1 -2.6 KB - Content
-
... ... @@ -1,76 +1,0 @@ 1 -<?xml version="1.0" encoding="UTF-8" ?> 2 - 3 -<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web 4 -Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> 5 - 6 -<!-- This web.xml file by itself will allow you to run the corresponding 7 - WebObjects application in a Servlet container. If you would like to 8 - merge the WebObjects application with your existing JSP/Servlet 9 - application, you have to merge this web.xml with your existing web.xml. 10 - 11 - NOTE: This file is normally included as the template file 'web.xml.template'. 12 - During the build process, the placeholders for WOROOT, LOCALROOT, WOAINSTALLROOT, 13 - WOAppMode, WOClassPath, WOApplicationClass and WOtaglib will be replaced 14 - with the appropriate values. Other parts of the template file may be 15 - customized as required. 16 - 17 - NOTE: WEBINFROOT is added to the WOClassPath at build time, but the replacement 18 - value is replaced at runtime to be the path to the WEB-INF directory. 19 ---> 20 - 21 -<web-app> 22 - <display-name>Your Application Name</display-name> 23 - <context-param> 24 - <param-name>WOJarBundle</param-name> 25 - <param-value>YES</param-value> 26 - <description> 27 - Whether this app is a "true" WAR, rather than a "stub" WAR 28 - or SSDD Note that WOROOT, LOCALROOT, WOAINSTALLROOT, 29 - WOClassPath are ignored if this is true However, if this is 30 - true, WOMainBundle must be set to the main bundle name 31 - </description> 32 - </context-param> 33 - 34 - <context-param> 35 - <param-name>WOMainBundle</param-name> 36 - <param-value>your-app-name</param-value> 37 - <description> 38 - Sets the name of the main bundle. Only used if WOJarBundle 39 - is true 40 - </description> 41 - </context-param> 42 - 43 - <!-- Indicates if application is development or deployment mode. In development 44 - mode, images are vended by the application directly from frameworks. In 45 - deployment mode, images are vended by the webserver. --> 46 - <context-param> 47 - <param-name>WOAppMode</param-name> 48 - <param-value>development</param-value> 49 - </context-param> 50 - 51 - <!-- Class name of the WOApplication subclass that defines the 52 - WebObjects application. --> 53 - <context-param> 54 - <param-name>WOApplicationClass</param-name> 55 - <param-value> 56 - your.package.Application 57 - </param-value> 58 - </context-param> 59 - 60 - <!-- The WebObjects Servlet that interfaces between the Servlet container 61 - world and the WebObjects world. --> 62 - <servlet> 63 - <servlet-name>WOServletAdaptor</servlet-name> 64 - <servlet-class> 65 - com.webobjects.jspservlet.WOServletAdaptor 66 - </servlet-class> 67 - <load-on-startup>5</load-on-startup> 68 - </servlet> 69 - 70 - <!-- URLs starting with 'WebObjects' use the WebObjects Servlet adaptor. --> 71 - <servlet-mapping> 72 - <servlet-name>WOServletAdaptor</servlet-name> 73 - <url-pattern>/WebObjects/*</url-pattern> 74 - </servlet-mapping> 75 -</web-app> 76 -